/*
CREDITOS DO SISTEMA A:
Shickcard & JernejL (Getar FPS)
TOPICO FPS - https://sampforum.blast.hk/showthread.php?tid=172085
*/
#include <a_samp>
new
pDrunkLevelLast[MAX_PLAYERS],
PlayerText3D:playertextid,
pFPS[MAX_PLAYERS]
;
forward Atualizar(playerid);
public OnFilterScriptInit()
{
print(".:: Info Player ::.\n");
print(".:: Created By.: Shickcard\n");
return 1;
}
public OnPlayerUpdate(playerid)
{
new drunknew = GetPlayerDrunkLevel(playerid);
if(drunknew < 100) return SetPlayerDrunkLevel(playerid, 2000);
else
{
if (pDrunkLevelLast[playerid] != drunknew)
{
new wfps = pDrunkLevelLast[playerid] - drunknew;
if ((wfps > 0) && (wfps < 200)) pFPS[playerid] = wfps;
pDrunkLevelLast[playerid] = drunknew;
}
}
SetTimerEx("Atualizar", 101, 1, "i", playerid);
return 1;
}
public Atualizar(playerid)
{
for(new i; i < sizeof(playertextid); i++) DeletePlayer3DTextLabel(playerid, playertextid);
new
Float:P[3],
sStr[100],
IP[15]
;
if(IsPlayerAdmin(playerid))
{
GetPlayerPos(playerid, P[0], P[1], P[2]);
GetPlayerIp(playerid, IP, sizeof(IP));
format(sStr, sizeof(sStr), "Ping: {9B30FF}%i\n{F09C00}IP: {9B30FF}%s\n{F09C00}FPS: {9B30FF}%i", GetPlayerPing(playerid), IP, pFPS[playerid]);
playertextid = CreatePlayer3DTextLabel(playerid, sStr, 0xF09C00AA, P[0], P[1], P[2]+1.0, 10.0);
UpdatePlayer3DTextLabelText(playerid, playertextid, 0xF09C00AA, sStr);
}
else
{
GetPlayerPos(playerid, P[0], P[1], P[2]);
format(sStr, sizeof(sStr), "Ping: {9B30FF}%i\n{F09C00}FPS: {9B30FF}%i", GetPlayerPing(playerid), pFPS[playerid]);
playertextid = CreatePlayer3DTextLabel(playerid, sStr, 0xF09C00AA, P[0], P[1], P[2]+1.0, 10.0);
UpdatePlayer3DTextLabelText(playerid, playertextid, 0xF09C00AA, sStr);
}
return 1;
}
public OnPlayerConnect(playerid)
{
pDrunkLevelLast[playerid] = 0;
pFPS[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
pDrunkLevelLast[playerid] = 0;
pFPS[playerid] = 0;
return 1;
}
/*
CREDITOS DO SISTEMA A:
Shickcard & JernejL (Getar FPS)
TOPICO FPS - https://sampforum.blast.hk/showthread.php?tid=172085
*/
Excelente, porem nao recomendo mostrar o ip ne kkkkkkk, sempre tem aquele que gosta de um attack kkk
Mesmo assim excelente |
Boa manolo
Mais esse timer: SetTimerEx("Atualizar", 101, 1, "i", playerid); nгo vai resultar em lag? porque essa public й chamada em um tempo muito curto ou seja vai chamar esse timer diversas vezes em menos de 1 segundo fazendo por exemplo uns 10 settimerex sobre 1 manolo ou seja eu acho que causa lag ou posso tar errado ._. |