04.03.2018, 05:17
Hi guys, i wanted to know how to make this thing works. This commands works setting the faction salary/pay but the players won't get the money every /signcheck or taking paycheck in bank/atm
and how to show it in /mysalary? Or please make me a new salary system with + $1/second and can be taken with /signcheck or taking paycheck.
/setfacpayand how to show it in /mysalary? Or please make me a new salary system with + $1/second and can be taken with /signcheck or taking paycheck.
Код:
CMD:facpay(playerid, params[]) {
if(PlayerInfo[playerid][pFMOD] >= 1) {
new
iFactionID,
iRankValue,
iPayValue;
if(sscanf(params, "ddd", iFactionID, iRankValue, iPayValue))
{
SendClientMessageEx(playerid, COLOR_WHITE, "[USAGE] /facpay [faction ID] [rank] [pay amount]");
SendClientMessageEx(playerid, COLOR_GRAD3, "|1 LSPD |2 SAGS |4 LSMD | 7 Army |9 SANA");
return 1;
}
if(!(0 <= iFactionID < sizeof(FactionPay))) {
return SendClientMessageEx(playerid, COLOR_WHITE, "Valid faction IDs run from 1,4,6,7 and 9 .");
}
else if(!(0 <= iRankValue <= 20)) {
return SendClientMessageEx(playerid, COLOR_WHITE, "Valid ranks are 0 to 20.");
}
else if(!(1 <= iPayValue <= 100000000)) {
return SendClientMessageEx(playerid, COLOR_GRAD1, "The specified pay amount must be between $1 and $100.000.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 %s.", iFactionID, iRankValue, FormatMoney(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, iRankValue, iPayValue);
Log("logs/admin.log", szMessage);
SaveThePay();
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "{007FFF}[Izin] {FFFFFF}Anda tidak memiliki izin untuk menggunakan perintah ini!");
return 1;
}
Код:
CMD:mysalary(playerid, params[])
{
new str[2048], count;
for(new s; s < MAX_PLAYER_SALARY; s++)
{
if(PlayerSalaryInfo[playerid][s][psValue] > 0)
{
format(str, sizeof(str), "%s%s\t%s\n", str, PlayerSalaryInfo[playerid][s][psDesc], FormatMoney(PlayerSalaryInfo[playerid][s][psValue]));
count++;
}
}
if(count > 0)
{
format(str, sizeof(str), "Description\tMoney\n%s", str);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_TABLIST_HEADERS, "Salary List", str, "Close", "");
}
if(PlayerInfo[playerid][pMember] > 0)
{
format(str, sizeof(str), "Description\nFaction Salary\nEarnings: %s", FormatMoney(PlayerInfo[playerid][pRank]*PlayerInfo[playerid][pDutyTime]/60+500));
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_TABLIST_HEADERS, "Salary List", str, "Close", "");
}
else
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Salary Notice", "Anda tidak memiliki salary saat ini!", "Close", "");
}
return 1;
}

