Hallo.
Ich habe einen Code, jedoch sehenn alle spiele die FPS von ID 0.
Wie kann man dies fixxen?
Mein Code:
stock UpdateFPS()
{
new string[126];
for(new i; i != MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,FPS);
format(string,sizeof(string),"FPS: %i",pFPS[i]);
TextDrawSetString(FPS,string);
TextDrawShowForPlayer(i,FPS);
}
}
return 1;
}
FPS = TextDrawCreate(546.000000, 59.000000, "FPS: 1");
TextDrawBackgroundColor(FPS, 255);
TextDrawFont(FPS, 1);
TextDrawLetterSize(FPS, 0.500000, 0.599998);
TextDrawColor(FPS, 16711935);
TextDrawSetOutline(FPS, 1);
TextDrawSetProportional(FPS, 1);
new drunknew;
drunknew = GetPlayerDrunkLevel(playerid);
if (drunknew < 100)
{
SetPlayerDrunkLevel(playerid, 2000);
}
else
{
if(pDrunkLevelLast[playerid] != drunknew)
{
new wfps = pDrunkLevelLast[playerid] - drunknew;
if ((wfps > 0) && (wfps < 200))
pFPS[playerid] = wfps;
pDrunkLevelLast[playerid] = drunknew;
}
}
MfG