11.01.2015, 21:32
I created an /hire for the fation leaders but it doenst set the players faction when they did /hire And i don't see the problem.
pawn Code:
CMD:hire(playerid, params[])
{
new playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /hire [playerid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(PlayerInfo[playerb][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is already in a faction.");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't invite yourself.");
new idx = Faction[playerb];
PlayerInfo[playerb][pFac] = Faction[playerid];
PlayerInfo[playerb][pFacRank] = 0;
FacInfo[idx][facMembers] ++;
PlayerInfo[playerb][pFacLeader] = 0;
PlayerInfo[playerb][pFacDiv] = 0;
PlayerInfo[playerb][pFacDivLeader] = 0;
Faction[playerid] = 0;
format(string, sizeof(string), " You hired %s in the faction %s.", RPN(playerb), RPFNEx(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s has hired you in the %s", RPN(playerid), RPFNEx(playerid));
SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
return 1;
}