04.04.2016, 18:34
Hi!
I'm trying to create a /invite command, but it returns SERVER: Unknown Command.
Although it compiles without errors, it fails on the following line:
Here's the array:
I'm trying to create a /invite command, but it returns SERVER: Unknown Command.
PHP код:
CMD:invite(playerid, params[]) {
new string[128], id;
if(PlayerInfo[playerid][pFaction] == 0) return SendErrorMessage(playerid, "You're not part of any faction.");
if(FactionRank[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionrank]][fInviteKick] < 1) return SendErrorMessage(playerid, "You do not have the permission required to invite new faction members.");
if(sscanf(params, "u", id)) return SendSyntaxMessage(playerid, "/invite <playerid/partofname>");
if(!IsPlayerConnected(id)) return SendErrorMessage(playerid, "Player is not connected.");
PlayerInfo[id][pFaction] = PlayerInfo[playerid][pFaction];
PlayerInfo[id][pFactionrank] = 1;
format(string, sizeof(string), "You've invited %s to the faction.", PlayerName(id, false));
SendInfoMessage(playerid, string);
format(string, sizeof(string), "You've been invited to %s by %s.", FactionInfo[PlayerInfo[playerid][pFaction]][fName], PlayerName(playerid, false));
SendInfoMessage(id, string);
return 1;
}
PHP код:
if(FactionRank[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionrank]][fInviteKick] < 1) return SendErrorMessage(playerid, "You do not have the permission required to invite new faction members.");
PHP код:
enum fRanks {
fID,
fFaction,
fRank,
fName[40],
fInviteKick,
fPromoteDemote,
fMoneyManage,
fBuildingManage,
fFactionManage
}; new FactionRank[MAX_FACTIONS][MAX_FACTIONRANKS][fRanks];