Remélem sscanf-t használod..
[pawn]
CMD:fps ( playerid, params [ ] )
{
new gPlayer;
if ( sscanf ( params, \"i\", gPlayer ) ) return SendClientMessage ( playerid, 0x0000FF, \"Használat: /fps [playerid]\" );
if ( !IsPlayerConnected ( gPlayer ) && ( gPalyer == INVALID_PLAYER_ID ) ) return SendClientMessage ( playerid, 0x0000FF, \"Játékos nincs csatlakozva\" );
new str [ 128 ];
format ( str, 128, \"%s FPS: %d\", pName ( gPlayer ), GetPlayerFPS ( gPlayer );
SendClientMessage ( playerid, blue, str );
return 1;
}
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;
}
[/pawn]