24.07.2015, 00:36
Se vocк quer utilizar o params, vocк pode fazer desse modo:
PHP код:
//Topo do GM:
new bool:IsPlayerAFK[MAX_PLAYERS];
CMD:afk(playerid, params[]) {
if(isnull(params)) return SendClientMessage(playerid,cor_vermelho,"/afk [on/off]");
new string[64];
if(!strcmp(params,"on",true)) {
IsPlayerAFK[playerid] = true;
SetPlayerPos(playerid, 322.197998,302.497985,999.148437);
SetPlayerInterior(playerid, 5);
SetPlayerHealth(playerid, 9999);
ResetPlayerWeapons(playerid);
format(string, sizeof string, "o Jogador (%s) Estб no /AFK", PlayerName(playerid));
SendClientMessageToAll(COR_ERRO, string);
else if(!strcmp(params,"off",true)) {
IsPlayerAFK[playerid] = false;
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
format(string, sizeof string, "o Jogador (%s) Saiu Do AFK /sairafk", PlayerName(playerid));
SendClientMessageToAll(COR_ERRO, string);
}
return 1;
}