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
#2

Bump?
Reply
#3

BUMP(2)
Reply
#4

bump(3)
Reply
#5

explain better,what exactly isn`t working from your code?
Reply
#6

Confusing To read
Reply
#7

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
explain better,what exactly isn`t working from your code?
Factions members don't get their salary correctly when signing paycheck.
Reply
#8

Show the /signcheck code
Reply
#9

Sorry for slow respond

/signcheck code
Код:
CMD:signcheck(playerid, params[])
{
  	if(PlayerInfo[playerid][pPDTime] <= 0)
	{
	    new String[10000];
		{
			if(PlayerInfo[playerid][pDonateRank] >= 2)
			{
				if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "Anda tidak bisa melakukannya saat menyetir.");
				if(PlayerInfo[playerid][pMember] != 0)
				{
					format(String, sizeof(String), "{FFFFFF}PayCheck : {FFFF00}$%s\n{ffffff}Duty Salary: {FFFF00}$%s\n{FFFFFF}Tax : {FF0000}-$%s (%d percent)\n{FFFFFF}Interest: {FFFF00}$%s", FormatMoney(PlayerInfo[playerid][pPayCheck]), FormatMoney(PlayerInfo[playerid][pRank]*PlayerInfo[playerid][pDutyTime]/60), FormatMoney((PlayerInfo[playerid][pPayCheck]/100)*TaxValue), TaxValue ,FormatMoney((PlayerInfo[playerid][pAccount]/100)*(1)));
				}
				else
				{
					format(String, sizeof(String), "{FFFFFF}PayCheck : {FFFF00}$%s\n{FFFFFF}Tax : {FF0000}-%s (%d percent)\n{FFFFFF}Interest: {FFFF00}$%s", FormatMoney(PlayerInfo[playerid][pPayCheck]), FormatMoney((( PlayerInfo[playerid][pPayCheck] / 100 ) * TaxValue)), TaxValue, FormatMoney((PlayerInfo[playerid][pAccount]/100)*(1)));
				}
				ShowPlayerDialog(playerid, 1150, DIALOG_STYLE_MSGBOX, "Sign PayCheck", String,"Get","Cancel");
			}
			else
			{
            if(IsAtBank(playerid))
                    {
				    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "Anda tidak bisa melakukannya saat menyetir.");
					if(PlayerInfo[playerid][pMember] != 0)
					{
						format(String, sizeof(String), "{FFFFFF}PayCheck : {FFFF00}$%s\n{ffffff}Duty Salary: {FFFF00}$%s\n{FFFFFF}Tax : {FF0000}-$%s (%d percent)\n{FFFFFF}Interest: {FFFF00}$%s", FormatMoney(PlayerInfo[playerid][pPayCheck]), FormatMoney(PlayerInfo[playerid][pRank]*PlayerInfo[playerid][pDutyTime]/60), FormatMoney((PlayerInfo[playerid][pPayCheck]/100)*TaxValue), TaxValue ,FormatMoney((PlayerInfo[playerid][pAccount]/100)*(1)));
					}
					else
					{
						format(String, sizeof(String), "{FFFFFF}PayCheck : {FFFF00}$%s\n{FFFFFF}Tax : {FF0000}-%s (%d percent)\n{FFFFFF}Interest: {FFFF00}$%s", FormatMoney(PlayerInfo[playerid][pPayCheck]), FormatMoney((( PlayerInfo[playerid][pPayCheck] / 100 ) * TaxValue)), TaxValue, FormatMoney((PlayerInfo[playerid][pAccount]/100)*(1)));
					}
					ShowPlayerDialog(playerid, 1150, DIALOG_STYLE_MSGBOX, "Sign PayCheck", String,"Get","Cancel");
				}
			}
			return 1;
		}
	    return 1;
	}
	else
	{
	    new String[10000], menit = PlayerInfo[playerid][pPDTime] / 60;
	    format(String, sizeof(String), "ERROR: Kamu dapat mengambil PayCheck %d menit lagi", menit);
	    SendClientMessageEx(playerid,COLOR_WHITE,String);
	}
	return 1;
}
Signcheck Dialog
Код:
	if(dialogid == 1150)
	{
	    if(response)
	   	{
	   	    PayCheck(playerid);
		}
		return 1;
	}
Reply
#10

Show the PayCheck code
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)