ganz oben
new Text:FPS[MAX_PLAYERS];
new DLlast[MAX_PLAYERS] = 0;
new FPS2[MAX_PLAYERS] = 0;
new stringss[24];
Onplayerdisconnect
TextDrawDestroy(FPS[playerid]);
Onplayerspawn
TextDrawShowForPlayer(playerid,FPS[playerid]);
OnGameModeInit
for(new i = 0; i < MAX_PLAYERS; i++)
{
FPS[i] = TextDrawCreate(323.000000,2.000000, "FPS: 30");
TextDrawBackgroundColor(FPS[i], 255);
TextDrawFont(FPS[i], 3);
TextDrawLetterSize(FPS[i], 0.480000, 2.000000);
TextDrawColor(FPS[i], -65281);
TextDrawSetOutline(FPS[i], 1);
TextDrawSetProportional(FPS[i], 1);
}
SetTimer("FPSUP",1203,true);
und bei onPlayerUpdate
if(DLlast[playerid] != drunk2)
{
new fps = DLlast[playerid] - drunk2;
if((fps > 0) && (fps < 200))
FPS2[playerid] = fps;
DLlast[playerid] = drunk2;
}
}
Und GANZ unten im Script
forward FPSUP();
public FPSUP()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(stringss,sizeof(stringss),"FPS: %d",FPS2[i]-1);
TextDrawSetString(FPS[i],stringss);
}
continue;
}
}
ocmd:fps(playerid,params[]) {
new pID,
string[64];
if(sscanf(params,"d",pID)) return SendClientMessage(playerid,0xFFFFFFFF,"FEHLER: Verwende /fps [SpielerID]");
format(string,sizeof(string),"FPS: %d",GetPlayerFPS(pID));
SendClientMessage(playerid,0xFFFFFFFF,string);
return 1;
}
stock GetPlayerFPS (playerid)
{
if(IsPlayerConnected(playerid))
{
return FPS2[playerid]-1;
}
else return 1;
}
das ist jeweils das man ingame selbst sieht wie viel fps man hat unt einmal ein befehl das andere fps man zu lesen bekommt mit /fps [id]