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;}
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\") < 200)) { return GetPVarInt(playerid, \"FPS\") - 1; } } } return 0;}
#include <a_samp>new pDrunkLevelLast[MAX_PLAYERS];new pFPS[MAX_PLAYERS];public OnFilterScriptInit(){ SetTimer(\"DisplayFPS\",1000,1); return 1;}public OnPlayerConnect(playerid) { pDrunkLevelLast[playerid] = 0; pFPS[playerid] = 0;}public OnPlayerUpdate(playerid) { // handle fps counters. new 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; } }}forward DisplayFPS();public DisplayFPS(){ new FPSmsg[20]; for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i)){ format(FPSmsg,20,\"Your FPS is: %d\",pFPS); //Show it here on-screen and set PVar }}
newg_pDrunkLevelLast[MAX_PLAYERS],g_pFPS[MAX_PLAYERS];// lekérés: g_pFPS[jatekosid]public OnPlayerUpdate(playerid){newdrunknew = GetPlayerDrunkLevel(playerid);if(drunknew < 100){SetPlayerDrunkLevel(playerid, 2000);}else{if(g_pDrunkLevelLast[playerid] != drunknew){ new wfps = g_pDrunkLevelLast[playerid] - drunknew; if(0 <= wfps <= 200) { g_pFPS[playerid] = wfps; } g_pDrunkLevelLast[playerid] = drunknew;}}return 1;}
function gPlayerFpsPing() {for(new playerid; playerid < MAX_PLAYERS; playerid++) {if(!IsPlayerConnected(playerid)) continue;if(GetPVarInt(playerid, \"fps\") == 1) { new drunknew = GetPlayerDrunkLevel(playerid); if(drunknew < 100) { SetPlayerDrunkLevel(playerid, 2000); }else{ if(g_pDrunkLevelLast[playerid] != drunknew) { new wfps = g_pDrunkLevelLast[playerid] - drunknew; if(0 <= wfps <= 200) { g_pFPS[playerid] = wfps; } g_pDrunkLevelLast[playerid] = drunknew; } } format(string, sizeof(string), \"~b~~h~~h~FPS: ~w~%i~n~~b~~h~~h~Ping: ~w~%i\", g_pFPS[playerid], GetPlayerPing(playerid)); PlayerTextDrawSetString(playerid, FpsTD, string);}}return 1;}
if(0 <= wfps <= 200)
if ((wfps > 0) && (wfps < 200))
Esetleg nem ez a hiba? Probáld meg így.. de jónak kell lennie.. :hmmm: if(0 <= wfps <= 200) helyett if ((wfps > 0) && (wfps < 200))