new Text:fpsfps[MAX_PLAYERS];
forward Fpstenso(playerid);
SetTimer("Fpstenso", 80, 1);
//********************************
for(new i = 0; i < MAX_PLAYERS; i++)
{
fpsfps[i] = TextDrawCreate(570.0, 340.0, " ");
TextDrawBackgroundColor(fpsfps[i], 16711935);
TextDrawFont(fpsfps[i], 1);
TextDrawLetterSize(fpsfps[i], 0.389999, 0.899999);
TextDrawColor(fpsfps[i], 255);
TextDrawSetOutline(fpsfps[i], 1);
TextDrawSetProportional(fpsfps[i], 1);
}
public Fpstenso()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new string[64];
TextDrawShowForPlayer(i, fpsfps[i]);
format(string,sizeof(string),"Fps: %i" ,GetPlayerFps(i));
TextDrawSetString(fpsfps[i], string);
}
}
format(string,sizeof(string),"Fps: %i" ,GetPlayerFps(i));
format(string,sizeof(string),"Fps: %i" ,GetPlayerFPS(i));
// inicio
static pFPS[MAX_PLAYERS], pDrunkLevelLast[MAX_PLAYERS]; // FPS
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;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
pDrunkLevelLast[playerid] = 0;
pFPS[playerid] = 0;
return 1;
}
// variavel pra getar fps -
pFPS[playerid]
D:\****\0.3e\gamemodes\BMMC.pwn(8253) : error 017: undefined symbol "GetPlayerFPS"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Eu acho que nгo vai fazer muita diferenзa, mas experimente utilizar ' %d ' ao invйs de ' %i '.
|
pawn Код:
|
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;
}