Faction Pay/Salary doesn't work
#1

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.
/setfacpay
Код:
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;
}
/mysalary
Код:
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;
}
Sorry. it uses Indonesia Language.
Reply


Messages In This Thread
Faction Pay/Salary doesn't work - by Dirda - 04.03.2018, 05:17
Re: Faction Pay/Salary doesn't work - by Dirda - 05.03.2018, 06:27
Re: Faction Pay/Salary doesn't work - by Dirda - 08.03.2018, 12:45
Re: Faction Pay/Salary doesn't work - by Dirda - 14.03.2018, 12:18
Re: Faction Pay/Salary doesn't work - by PepsiCola23 - 14.03.2018, 12:26
Re: Faction Pay/Salary doesn't work - by Dolf - 14.03.2018, 18:53
Re: Faction Pay/Salary doesn't work - by Dirda - 18.03.2018, 08:36
Re: Faction Pay/Salary doesn't work - by MadeMan - 18.03.2018, 11:50
Re: Faction Pay/Salary doesn't work - by Dirda - 30.03.2018, 13:43
Re: Faction Pay/Salary doesn't work - by MadeMan - 30.03.2018, 13:54

Forum Jump:


Users browsing this thread: 3 Guest(s)