21.02.2019, 02:29
I see no major problem, so no clue but some minor problems
Same with SaveFactions, change your variables to arrays
PHP код:
CMD:facpay(playerid, params[])
{
// ...
// you can combine the amount checks
if(amount > 300000 || amount <= 0) return // ...
// missing rank check
if(!(0 <= rank <= 10)) return // ...
// use arrays inside enums "fPay[10]"
new idx = PlayerInfo[playerid][pFac];
FacInfo[idx][fPay][rank] = amount;
format(string, sizeof(string), "You have set rank %d's pay to %d", rank + 1, amount);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
PHP код:
stock FACPAY(playerid)
{
new pay[10];
new faction = PlayerInfo[playerid][pFac];
if(faction) { // rank as array like above
strcat(pay, FacInfo[faction][fPay][ PlayerInfo[playerid][pFacRank] ]);
} else {
pay = "None";
}
return pay;
}