24.07.2014, 16:54
Currently I have a filterscript made for my factions, and I want to know why this isn't working.
The line "if(pInfo[playerid][pAdmin] => 2);" is an undefined symbol when compiling, but it's not in my main script. How can I make this work?
pawn Код:
CMD:setleader(playerid, params[])
{
//if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"rcon");
if(pInfo[playerid][pAdmin] => 2);
{
new ID,orgid;
if (sscanf(params, "ud", ID,orgid)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setleader [playerid] [orgid]");
if (!IsPlayerConnected(ID)) return 1;
if (PlayerOrg[ID]) return SendClientMessage(playerid, COLOR_RED,"That player already belongs to an organization");
if (orgid < 1 || orgid > OrgsCount) return SendClientMessage(playerid, COLOR_RED,"Invalid org. ID!");
new string[140];
format(string,sizeof(string),"Admin %s has made you leader of the faction %s!", PlayerName(playerid), GetOrgName(orgid));
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have set %s the leader of %s", PlayerName(ID), GetOrgName(orgid));
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerOrg[ID] = orgid;
PlayerLeader[ID] = 1;
Organization[orgid][Leader] = PlayerName(ID);
SaveLeaders();
SavePlayerOrgInfo(ID);
GiveOrgFeatures(ID);
}
return 1;
}