i Have problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i Have problem (
/showthread.php?tid=624651)
i Have problem -
TYDS - 20.12.2016
Код:
new Text:Pingvafps[3];
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
Код:
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;
}
Код:
public OnPlayerUpdate(playerid)
{
new drunknew;
drunknew = GetPlayerDrunkLevel(playerid);
if (drunknew < 100) { // go back up, keep cycling.
SetPlayerDrunkLevel(playerid, 2000);
} else {
if (pDrunkLevelLast[playerid] != drunknew) {
new wfps = pDrunkLevelLast[playerid] - drunknew;
if ((wfps > 0) && (wfps < 200))
pFPS[playerid] = wfps;
pDrunkLevelLast[playerid] = drunknew;
}
}
return 1;
}
Код:
forward PINGVAFPS(playerid);
public PINGVAFPS(playerid)
{
for(new x= 0; x <=2; x++) TextDrawShowForPlayer(playerid, Pingvafps[x]);
new string[1280];
format(string, sizeof string, "FPS: %d", GetPlayerFPS(playerid));
TextDrawSetString(Pingvafps[1], string);
format(string, sizeof string, "Ping: %d", GetPlayerPing(playerid));
TextDrawSetString(Pingvafps[2], string);
}
Код:
public OnPlayerSpawn(playerid)
{
PINGVAFPS(playerid);
return 1;
}
it's not show fps and, ping is not update

show how can i fix
Re: i Have problem -
TYDS - 21.12.2016
bump
Re: i Have problem -
itsCody - 21.12.2016
What's wrong with GetPlayerPing?
https://sampwiki.blast.hk/wiki/GetPlayerPing
Re: i Have problem -
TYDS - 21.12.2016
help