02.02.2017, 18:31
Here you go
PHP код:
CMD:warcall(playerid, params[])
{
if(PlayerInfo[playerid][pLeader] == 0)
{
GRESKA(playerid, "You are not allowed");
return 1;
}
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 24 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pLeader] == 8 || PlayerInfo[playerid][pLeader] == 18)
{
GRESKA(playerid, "You can't be in war");
return 1;
}
new target;
if(sscanf(params, "u", target))
{
USAGE(playerid, "/warcall [ID]");
INFO(playerid, "Invited must be a leader");
return 1;
}
if(IsPlayerConnected(target))
{
GRESKA(playerid, "that player is not online");
return 1;
}
if(PlayerInfo[target][pLeader] == 1 || PlayerInfo[target][pLeader] == 24 || PlayerInfo[target][pLeader] == 2 || PlayerInfo[target][pLeader] == 3 || PlayerInfo[target][pLeader] == 4 || PlayerInfo[target][pLeader] == 9 || PlayerInfo[target][pLeader] == 10 || PlayerInfo[target][pLeader] == 8 || PlayerInfo[target][pLeader] == 18)
{
GRESKA(playerid, "Those can't be in war");
return 1;
}
if(target == playerid)
{
GRESKA(playerid, "You can't call yourself");
return 1;
}
if(PlayerInfo[target][pLeader] == 0)
{
GRESKA(playerid, "That player is not leader");
return 1;
}
if(WarInvited[target] == 1)
{
GRESKA(playerid, "That player has already been invited");
return 1;
}
if(PlayerInfo[target][pWarEntered] == 1)
{
GRESKA(playerid, "That player is in war");
return 1;
}
WarInvited[target] = 1;
WarInviter[target] = playerid;
PlayerInfo[playerid][pWarEntered] = 1;
PlayerInfo[target][pWarEntered] = 1;
new string[128];
format(string, sizeof(string), "Player %s has called you in war.\nChoose and option bellow", PlayerName(playerid));
ShowPlayerDialog(target, DIALOG_WARINVITE, DIALOG_STYLE_MSGBOX, "War", string, "Accept", "Decline");
return 1;
}