Код
if(strcmp(cmd, "/setarmor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Regio[N]: /setarmor [playerid/PartOfName] [armor]");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GiveArmour(playa, health);
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(GainAdmin[i] == 1)
{
new admin[MAX_PLAYER_NAME]; new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, admin,sizeof(admin));
GetPlayerName(playa, player,sizeof(player));
if(playerid == playa)
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s äàë ñåáå áðîíþ (êîë-âî: %d).",admin,health);
}
else
{
format(string,sizeof(string),"Gain Admin: {FFFFFF}%s äàë èãðîêó %s áðîíþ (êîë-âî: %d).",admin,player,health);
}
SendClientMessage(i, COLOR_LIGHTRED, string);
}
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Íåäîñòàòî÷íî ïðàâ äëÿ èñïîëüçîâàíèÿ êîìàíäû.");
}
}