CMD:hire doesnt work prob.
#3

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];
    FacInfo[idx][facMembers] ++;
    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;
}
Try this
Reply


Messages In This Thread
CMD:hire doesnt work prob. - by lulo356 - 11.01.2015, 21:32
Re: CMD:hire doesnt work prob. - by lulo356 - 12.01.2015, 09:08
Re: CMD:hire doesnt work prob. - by Rabea - 12.01.2015, 09:11
Re: CMD:hire doesnt work prob. - by HazardouS - 12.01.2015, 09:14

Forum Jump:


Users browsing this thread: 1 Guest(s)