18.10.2012, 03:04
(
Последний раз редактировалось rogerioexper; 18.10.2012 в 04:10.
)
Quote:
nao sei se й bug mais quando eu uso /limparlider ele limpa o lider se estiver on mais nao limpa se estiver OFF por favor alguem ajuda ai |
PHP код:
if (strcmp("/limparlider", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 4000)
{
SendClientMessage(playerid, COLOR_GRAD2, "Somente admins master ou dono podem usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparlider [organizaзгo]");
return 1;
}
new Vaga2 = strval(tmp);
if(Vaga2 < 1 || Vaga2 > 23)
{
SendClientMessage(playerid, COLOR_GREY, "Vaga mнnima 1 mбximo 23!"); return 1; }
new id=GetPlayerID(InfoOrg[Vaga2][Lider]);
format(string, sizeof(string), "ADMIN: %s limpou a vaga %d do lнder %s",PlayerName(playerid), Vaga2, InfoOrg[Vaga2][Lider]);
LideresLog(string);
if(IsPlayerOnline(InfoOrg[Vaga2][Lider])) DemitirLider(id);
strmid(InfoOrg[Vaga2][Lider], "Ninguem", 0, strlen("Ninguem"), 255);
format(gstring, 128, "ORG Arquivos/Org%d.cfg", Vaga2);
dini_Set(gstring,"Lider","Ninguem");
format(string, sizeof(string), "Vocк limpou o lнder da organizaзгo Nє %d",Vaga2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
stock DemitirLider(playerid)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк foi demitido de lнder por um admin, agora vocк й um Civil !");
gTeam[playerid] = 3;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pRank] = 0;
if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 289; } else { PlayerInfo[playerid][pSkin] = 12; }
SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
MedicBill[playerid] = 0;
}
stock LideresLog(string[])
{
new entry[128];
format(entry, sizeof(entry), "%s\n",string);
new File:hFile;
hFile = fopen("Logs/lider.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
return 1;
}