16.06.2013, 18:21
pawn Код:
// Topo do GM
stock DemitirAdmin(playerid)
{
new Fala[55];
format(Fala,sizeof(Fala),"O Administrador %s perdeu o seu posto.",PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED,Fala);
PlayerInfo[playerid][pAdmin] = 0;
admtrampando[playerid] = 0;
SpawnPlayerEx(playerid);
return 1;
}
// Comando
if(strcmp("/limparadm", cmdtext, true, 10) == 0 || strcmp("/limparadmin", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 9)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo estб autorizado a usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadmin [ nъmero ]");
return 1;
}
new Vagao = strval(tmp);
if(Vagao < 1 || Vagao > 10) { SendClientMessage(playerid, COLOR_GREY, "Nъmero mнnimo 1 mбximo 10!"); return 1; }
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s limpou a vaga %d de %s [%d/%d/%d] бs [%d:%d:%d].", PlayerName(playerid), Vagao, AdmInfo[Vagao][gMembro], day,
month, year, hour, minute, second);
print(string);
new id = GetPlayerID(AdmInfo[Vagao][gMembro]);
if(IsPlayerOnline(AdmInfo[Vagao][gMembro])) DemitirAdmin(id);
strmid(AdmInfo[Vagao][gMembro], "Vazio", 0, strlen("Vazio"), 999);
AdmInfo[Vagao][AdminVaga] = 0;
format(string, sizeof(string), "Vocк limpou o Admin N° %d",Vagao);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SaveAdm();
return 1;
}