17.06.2013, 23:29
pawn Код:
new cBloqueado[MAX_PLAYERS];
CMD:afk(playerid,params[]){
if(AFK[playerid] ==0){
new string[128];
format(string,sizeof(string),"( AFK ) O jogador %s (%d) foi bloqueado de upar por ficar longe do teclado!", PlayerName(playerid), playerid);
SendClientMessageToAll(0x00FF00AA, string);
for(new i = 0; i < 100; i++)
SendClientMessage(playerid,-1,"");
TextDrawShowForPlayer(playerid, TDAFK);
TextDrawShowForPlayer(playerid, TDAFK1);
TextDrawShowForPlayer(playerid, TDAFK2);
TextDrawShowForPlayer(playerid, TDAFK3);
AFK[playerid] =1;
cBloqueado[playerid] = 1;
SetPlayerHealth(playerid, 99999);
TogglePlayerControllable(playerid, 0);
}else{
SendClientMessage(playerid,0xFF6347AA,"(ERRO) Vocк ja estб ausente (AFK).");
return 1;
}
return 1;
}
CMD:online(playerid,params[]){
if(AFK[playerid] ==1){
new string[128];
format(string,sizeof(string),"( ON ) O jogador %s (%d) estб online novamente!", PlayerName(playerid), playerid);
SendClientMessageToAll(0x00FF00AA, string);
TextDrawHideForAll(TDAFK);
TextDrawHideForAll(TDAFK1);
TextDrawHideForAll(TDAFK2);
TextDrawHideForAll(TDAFK3);
AFK[playerid] =0;
cBloqueado[playerid] = 0;
SetPlayerHealth(playerid, 100);
TogglePlayerControllable(playerid, 1);
}else{
SendClientMessage(playerid,0xFF6347AA,"(ERRO) Vocк nгo estб ausente (AFK).");
return 1;
}
return 1;
}
//adcione isto em todos os comandos,exceto /afk e /online.
if(cBloqueado[playerid] == 1) return SendClientMessage(playerid,-1,"Os comandos estгo bloqueados pois vocк estб AFK,para serem desbloqueados fique /online !");