Scripting Help!
#1

I found on internet this FPS: system and it works on textdraw's fine but only the first player that connects on server has FPS: worked , other FPS: 0
Can someone help me !
Pawn Code:
forward ScorenPing(playerid);
public ScorenPing(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i))
{
new string[256];
format(string,sizeof(string),"Score: ~p~%d ~w~Ping: ~p~%d ~w~FPS: ~p~%d ~w~Players: ~p~%d",GetPlayerScore(playerid),GetPlayerPing(play erid),GetPlayerFPS(playerid),GetOnLinePlayers());
TextDrawSetString(scoreandping[i], string);
}
}
}
i have stock for that GetPlayerFPS
stock GetPlayerFPS(playerid)
{
SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
if(GetPVarInt(playerid, "DrunkL") < 100)
{
SetPlayerDrunkLevel(playerid, 2000);
}
else
{
if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
{
SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
{
return GetPVarInt(playerid, "FPS") - 1;
}
}
}
return 0;
}
Please help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)