28.03.2015, 14:40
Tente desta maneira:
PHP код:
//Sistema AFK By: MatheusSpohr
new bool:AFK[MAX_PLAYERS], TaAFK[300], NaoTaAFK[300], Nome[24], MotivoAFK[30];
CMD:afk(playerid, params[])
{
SendAdminText(playerid, "/Afk", params);
if(AFK[playerid] == true) return SendClientMessage(Branco, 128, "{FFFF00}[INFO]:{0000FF} Vocк Jб Estб AFK, Use: /SairAFK");
if(APlayerData[playerid][JobStarted] == true) return SendClientMessage(Branco, 128, "{FFFF00}[INFO]:{0000FF}Vocк Nгo Pode Utilizar Este Comando Enquanto Estiver Realizando Um Trabalho.");
if(sscanf(params, "s[30]", MotivoAFK)) return SendClientMessage(playerid, Branco, "{FFFF00}[INFO]:{FF0000} Use: /AFK [Motivo]");
GetPlayerName(playerid, Nome, sizeof(Nome));
TogglePlayerControllable(playerid, 0);
AFK[playerid] = true;
format(TaAFK, sizeof(TaAFK), "{FFFF00}[Sistema AFK]: {FF1493}O Jogador {FFFFFF}%s [ID:%d] {FF1493}Estб Ausente.(Razгo:%s)", Nome, playerid, MotivoAFK);
SendClientMessageToAll(Branco, TaAFK);
return true;
}
CMD:sairafk(playerid, params[])
{
SendAdminText(playerid, "/SairAfk", params);
GetPlayerName(playerid, Nome, sizeof(Nome));
if(AFK[playerid] == false) return SendClientMessage(Branco, 128, "{FFFF00}[INFO]:{0000FF}Vocк Nгo Estб AFK!");
TogglePlayerControllable(playerid, 1);
AFK[playerid] = false;
format(NaoTaAFK, sizeof(NaoTaAFK), "{FFFF00}[Sistema AFK]: {FF1493}O Jogador {FFFFFF}%s [ID:%d] {FF1493}Voltou Ao Jogo.", Nome, playerid);
GameTextForPlayer(playerid, "~W~Voce Saiu Do Modo AFK!", 5000, 1);
SendClientMessageToAll(Branco, NaoTaAFK);
return true;
}//Sistema AFK By: MatheusSpohr