05.10.2016, 01:38
/makefleader doesn't work even compiling is successful, any idea on what's wrong with this code?
Player Data:

Before entering the command:

After entering the command:
PHP Code:
CMD:makefleader(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
new targetid, faction;
if(sscanf(params, "Ui", targetid, faction)) return SCM(playerid, COLOR_RED, "USAGE: /makefleader [name/id] [faction]");
if(targetid != INVALID_PLAYER_ID)
{
PlayerInfo[targetid][pFaction] = faction;
PlayerInfo[targetid][pFRank] = 10;
PlayerInfo[targetid][pFLeader] = faction;
if(faction == 1)
{
SCM(targetid, COLOR_LIGHTBLUE, "An admin has made a you faction leader of the Los Santos Police Department.");
SendClientMessage(targetid, COLOR_LIGHTBLUE, "You are now leader of the Los Santos Police Department.");
}
}
else
{
SCM(playerid, COLOR_RED, "This player is not connected.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Your Administration rank is not high enough to access this command");
}
return 1;
}

Before entering the command:

After entering the command:
