SA-MP Forums Archive
Facpay - doesnt approve above rank 6 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Facpay - doesnt approve above rank 6 (/showthread.php?tid=302076)



Facpay - doesnt approve above rank 6 - Roberto Saviano - 07.12.2011

Hello, when i enter /facpay 1 7 1 i get the error unknown command (default by samp) however when i do /facpay 1 6 1, it works perfectly.
I have edited this line to 8 instead of 6, however ingame the command doesnt approves it.
''else if(iRankValue > 8 || iRankValue < 0) {''

Anyone that might have a solution, as Chief and Deputy Chief is above 6, and therefor wont get any paychecks.

Quote:

CMD:facpay(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pFactionModerator] == 1) {

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 13.");
}
else if(iRankValue > 8 || iRankValue < 0) {
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;
}




Re: Facpay - doesnt approve above rank 6 - [ABK]Antonio - 07.12.2011

else if(iRankValue > 6 || iRankValue < 0)
add an if in there to exlude chiefs or w/e

else if(iPayValue > 100000 || iPayValue < 0))


Re: Facpay - doesnt approve above rank 6 - Roberto Saviano - 07.12.2011

Yet it wasnt what i asked for Antonio, i asked what is wrong with the code since it wont let me use above 6 as rank?


Re: Facpay - doesnt approve above rank 6 - Roberto Saviano - 08.12.2011

bump.