20.02.2019, 22:29
Hello! When i use /facpay to set faction rank payment it only lets to set 2 ranks and even those two ranks wount work! Could you please help me i cant figure out whats the problem.
Here's the command:
Heres anotherone
And here's dini:
Here's the command:
Код:
CMD:facpay(playerid, params[]) { new rank, amount, string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command."); if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader."); if(sscanf(params, "ui", rank, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /facpay (Currently not working)"); if(amount > 300000) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Amount"); if(amount <= 0) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Amount"); new idx = PlayerInfo[playerid][pFac]; if(PlayerInfo[playerid][pFacLeader]) switch(rank) { case 0: { FacInfo[idx][fPay1] = amount; format(string, sizeof(string), "You have set rank 1's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 1: { FacInfo[idx][fPay2] = amount; format(string, sizeof(string), "You have set rank 2's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 2: { FacInfo[idx][fPay3] = amount; format(string, sizeof(string), "You have set rank 3's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 3: { FacInfo[idx][fPay4] = amount; format(string, sizeof(string), "You have set rank 4's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 4: { FacInfo[idx][fPay5] = amount; format(string, sizeof(string), "You have set rank 5's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 5: { FacInfo[idx][fPay6] = amount; format(string, sizeof(string), "You have set rank 6's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 6: { FacInfo[idx][fPay7] = amount; format(string, sizeof(string), "You have set rank 7's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 7: { FacInfo[idx][fPay8] = amount; format(string, sizeof(string), "You have set rank 8's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 8: { FacInfo[idx][fPay9] = amount; format(string, sizeof(string), "You have set rank 9's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 9: { FacInfo[idx][fPay10] = amount; format(string, sizeof(string), "You have set rank 10's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } case 10: { FacInfo[idx][fPay11] = amount; format(string, sizeof(string), "You have set rank 11's pay to %d", amount); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } return 1; }
Код:
stock FACPAY(playerid) { new pay[10]; if(PlayerInfo[playerid][pFacRank] == 0 && PlayerInfo[playerid][pFac] == 0) format(pay, sizeof(pay), "None"); else if(PlayerInfo[playerid][pFac]) { if(PlayerInfo[playerid][pFacRank] == 0) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay1]); else if(PlayerInfo[playerid][pFacRank] == 1) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay2]); else if(PlayerInfo[playerid][pFacRank] == 2) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay3]); else if(PlayerInfo[playerid][pFacRank] == 3) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay4]); else if(PlayerInfo[playerid][pFacRank] == 4) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay5]); else if(PlayerInfo[playerid][pFacRank] == 5) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay6]); else if(PlayerInfo[playerid][pFacRank] == 6) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay7]); else if(PlayerInfo[playerid][pFacRank] == 7) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay8]); else if(PlayerInfo[playerid][pFacRank] == 8) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay9]); else if(PlayerInfo[playerid][pFacRank] == 9) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay10]); else if(PlayerInfo[playerid][pFacRank] == 10) format(pay, sizeof(pay), "%d", FacInfo[PlayerInfo[playerid][pFac]][fPay11]); } return pay; }
Код:
stock SaveFactions() { // LSPD new file[64]; format(file, sizeof(file), "factions/LSPD.ini"); if(!dini_Exists(file)) dini_Create(file); dini_Set(file, "LSPDMembers", FacInfo[1][facMembers]); dini_Set(file, "Rank1", FacInfo[1][fRank1]); dini_Set(file, "Rank2", FacInfo[1][fRank2]); dini_Set(file, "Rank3", FacInfo[1][fRank3]); dini_Set(file, "Rank4", FacInfo[1][fRank4]); dini_Set(file, "Rank5", FacInfo[1][fRank5]); dini_Set(file, "Rank6", FacInfo[1][fRank6]); dini_Set(file, "Rank7", FacInfo[1][fRank7]); dini_Set(file, "Rank8", FacInfo[1][fRank8]); dini_Set(file, "Rank9", FacInfo[1][fRank9]); dini_Set(file, "Rank10", FacInfo[1][fRank10]); dini_Set(file, "Rank10", FacInfo[1][fRank11]); dini_Set(file, "Div1", FacInfo[1][fDiv1]); dini_Set(file, "Div2", FacInfo[1][fDiv2]); dini_Set(file, "Div3", FacInfo[1][fDiv3]); dini_Set(file, "Div4", FacInfo[1][fDiv4]); dini_Set(file, "Div5", FacInfo[1][fDiv5]); format(file, sizeof(file), "factions/LSPD.ini"); dini_Set(file, "Pay1", FacInfo[1][fPay1]); dini_Set(file, "Pay2", FacInfo[1][fPay2]); dini_Set(file, "Pay3", FacInfo[1][fPay3]); dini_Set(file, "Pay4", FacInfo[1][fPay4]); dini_Set(file, "Pay5", FacInfo[1][fPay5]); dini_Set(file, "Pay6", FacInfo[1][fPay6]); dini_Set(file, "Pay7", FacInfo[1][fPay7]); dini_Set(file, "Pay8", FacInfo[1][fPay8]); dini_Set(file, "Pay9", FacInfo[1][fPay9]); dini_Set(file, "Pay10", FacInfo[1][fPay10]); dini_Set(file, "Pay11", FacInfo[1][fPay11]); print("BCSD files saved successfully.");