22.07.2012, 14:52
Ahh tamйm oquando usava um dos comandos acima da Unkown Comand.
Ahh o /demitir funciona normalmente.
Ahh o /demitir funciona normalmente.
pawn Код:
if(strcmp(cmd, "/Demitir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/Demitir [ID/NICK] [Motivo]");
return true;
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] > 0 || PlayerInfo[playerid][pCargo] == 555 || PlayerInfo[playerid][pCargo] == 444)
{
new lolz = GetPlayerOrg(playerid);
if(PlayerInfo[para1][pMembro] != lolz)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode demitir quem nгo й da sua org.");
return true;
}
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMembro] > 0)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /Demitir [ID/NICK] [Motivo]");
return true;
}
DemitirInfoOrg(PlayerName(para1));
format(string, sizeof(string), "* Vocк foi demitido pelo lнder %s Motivo: %s.", sendername, (result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
SendClientMessage(para1, COLOR_LIGHTBLUE, "* Agora vocк й um civil novamente.");
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
PlayerInfo[para1][pMembro] = 0;
PlayerInfo[para1][pCargo] = 0;
if(PlayerInfo[para1][pSex] == 1) { PlayerInfo[para1][pSkin] = 23; } else { PlayerInfo[para1][pSkin] = 41; }
SetSpawnInfo(para1, gTeam[para1], PlayerInfo[para1][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
MedicBill[para1] = 0;
SpawnPlayer(para1);
format(string, sizeof(string), "Vocк demitiu %s, Motivo: %s.", giveplayer, result);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return true;
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder!");
}
return true;
}