Compiling Errors
#1

When i added these new CMDs of /hanamechange and /fbinamechange and now everyone can use this xD i wanted to make each CMD restricted to faction members but when i put
pawn Код:
if(PlayerInfo[playerid][pMember] == 8)
and then compile i get errors why

here are the CMDs

pawn Код:
CMD:hanamechange(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 296.1883,-104.7234,1001.5156)) return SendClientMessage(playerid, COLOR_GRAD1, "  You must be inside your HQ to do this!");
    new bool:isthereadmin = false;
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 3)
        {
            isthereadmin = true;
            break;
        }
    }
    if(isthereadmin == false) return SendClientMessage(playerid, COLOR_GRAD1, "  No admins can currently accept your name change request! Try again later.");
    if(sscanf(params, "s[24] s[128]", tmp))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hanamechange [New Name]");
        return 1;
    }
    new tmp2[128];
    new namechangeprice = 0;
    if(GetMoney(playerid) < namechangeprice) return SendClientMessage(playerid, COLOR_GRAD1, "  You don't have enough money for that!");
    if(sscanf(params, "s[24] s[128]", tmp,tmp2))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hanamechange [New Name] [confirm]");
        format(string, sizeof(string), "  Are you sure you want to change your name to %s for free?", tmp);
        SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
    }
    format(string, sizeof(string), "%s.ini", tmp);
    if(fexist(string))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   That name is already registered.");
        return 1;
    }
    if(strlen(tmp) <= 4) return SendClientMessage(playerid, COLOR_GRAD1, "  The new name must be at least 5 characters long!");
    if(strlen(tmp) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_GRAD1, "  The new name can not be longer than 20 character!");
    if(!AlphaNumericName(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "  Invalid name!");
    if(strcmp(tmp2, "confirm", true) != 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hanamechange [New Name] [confirm]");
        format(string, sizeof(string), "  Are you sure you want to change your name to %s for $%d?", tmp, namechangeprice);
        SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
    }
    else if(strcmp(tmp2, "confirm", true) == 0)
    {
        HaNameChange[playerid] = 1;
        strmid(NameChangeRequest[playerid], tmp, 0, strlen(tmp));
        format(string, sizeof(string), "[FBI NameChange request]: %s [%d] wants to namechange to %s.", PlayerRPName(playerid), playerid, tmp);
        SendAdminMessage(COLOR_YELLOW, string);
        format(string, sizeof(string), "[FBI NameChange request]: /approvename %d or /denyname %d to approve/deny this request.", playerid, playerid);
        SendAdminMessage(COLOR_YELLOW, string);
        SendClientMessage(playerid, COLOR_GREEN, "** Your name change request was sent to the administrators! Wait for someone to approve it!");
    }
    return 1;
}

CMD:fbinamechange(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 234.7594,112.1979,1010.2188)) return SendClientMessage(playerid, COLOR_GRAD1, "  You must be near your locker room!");
    new bool:isthereadmin = false;
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 3)
        {
            isthereadmin = true;
            break;
        }
    }
    if(isthereadmin == false) return SendClientMessage(playerid, COLOR_GRAD1, "  No admins can currently accept your name change request! Try again later.");
    if(sscanf(params, "s[24] s[128]", tmp))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fbinamechange [New Name]");
        return 1;
    }
    new tmp2[128];
    new namechangeprice = 0;
    if(GetMoney(playerid) < namechangeprice) return SendClientMessage(playerid, COLOR_GRAD1, "  You don't have enough money for that!");
    if(sscanf(params, "s[24] s[128]", tmp,tmp2))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fbinamechange [New Name] [confirm]");
        format(string, sizeof(string), "  Are you sure you want to change your name to %s for free?", tmp);
        SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
    }
    format(string, sizeof(string), "%s.ini", tmp);
    if(fexist(string))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   That name is already registered.");
        return 1;
    }
    if(strlen(tmp) <= 4) return SendClientMessage(playerid, COLOR_GRAD1, "  The new name must be at least 5 characters long!");
    if(strlen(tmp) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_GRAD1, "  The new name can not be longer than 20 character!");
    if(!AlphaNumericName(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "  Invalid name!");
    if(strcmp(tmp2, "confirm", true) != 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /namechange [New Name] [confirm]");
        format(string, sizeof(string), "  Are you sure you want to change your name to %s for $%d?", tmp, namechangeprice);
        SendClientMessage(playerid, COLOR_WHITE, string);
        return 1;
    }
    else if(strcmp(tmp2, "confirm", true) == 0)
    {
        HaNameChange[playerid] = 1;
        strmid(NameChangeRequest[playerid], tmp, 0, strlen(tmp));
        format(string, sizeof(string), "[FBI NameChange request]: %s [%d] wants to namechange to %s.", PlayerRPName(playerid), playerid, tmp);
        SendAdminMessage(COLOR_YELLOW, string);
        format(string, sizeof(string), "[FBI NameChange request]: /approvename %d or /denyname %d to approve/deny this request.", playerid, playerid);
        SendAdminMessage(COLOR_YELLOW, string);
        SendClientMessage(playerid, COLOR_GREEN, "** Your name change request was sent to the administrators! Wait for someone to approve it!");
    }
    return 1;
}
Reply
#2

Post the errors..
Reply
#3

well,post the errors,by the way it would be hard for you to use these commands/create them because you are kind of a beginner,you must learn before making
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)