29.04.2012, 22:32
I'm sleepy as hell and I need to finish a few things before I go to bed, so please tell me what the hell is wrong because I can't see.
pawn Код:
YCMD:invite(playerid, params[], help)
{
#pragma unused help
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pCop] != 2)
{
SendClientMessage(playerid, -1, "You are not an Admin or a Cop chief.");
}
else if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pCop] == 2)
{
new PlayerID, PlayerName[MAX_PLAYER_NAME], TargetName[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "u", PlayerID)) return SendClientMessage(playerid, -1, "Usage mode: /invite [PlayerName / ID]");
if(PlayerID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[ERROR] Invalid ID.");
PlayerInfo[PlayerID][pCop] = 1;
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
GetPlayerName(PlayerID, TargetName, sizeof(TargetName));
format(string, sizeof(string), "You have been promoted to cop by %s.", PlayerName);
SendClientMessage(PlayerID, -1, string);
format(string, sizeof(string), "You have invited %s to cop.", TargetName);
SendClientMessage(playerid, -1, string);
}
return 1;
}