Help Paycheck
#1

I need change amount paycheck but i change amount anyhow not
Here is code :
Код:
if(PlayerInfo[i][pConnectSeconds] >= 3600) {
			if(GetPVarType(i, "AdvisorDuty")) {
				PlayerInfo[i][pDutyHours]++;
			}
			if(SpecTimer) AddSpecialToken(i);
			SendClientMessageEx(i, COLOR_WHITE, "________ THONG TIN NGAN HANG ________");
			if(PlayerInfo[i][pNation] == 0)
			{
				format(string, sizeof(string), "  Paycheck: $%s  |  SA Gov Tax: $%s (%d phan tram)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue), TaxValue);
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
				Tax += (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
			}
			else if(PlayerInfo[i][pNation] == 1)
			{
				format(string, sizeof(string), "  Paycheck: $%s  |  TR Gov Tax: $%s (%d phan tram)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
				TRTax += (PlayerInfo[i][pPayCheck] / 1) * TRTaxValue;
			}
			SendClientMessageEx(i, COLOR_GRAD1, string);
			interest = (PlayerInfo[i][pAccount] + 1) / 10;

			if(PlayerInfo[i][pTaxiLicense] == 1) {
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * 5;
				Tax += (PlayerInfo[i][pPayCheck] / 100) * 5;
				format(string, sizeof(string), "  Le phi giay phep Taxi (5 phan tram): $%s", number_format((PlayerInfo[i][pPayCheck] / 100) * 5));
				SendClientMessageEx(i, COLOR_GRAD2, string);
			}
			for(new iGroupID; iGroupID < MAX_GROUPS; iGroupID++)
			{
				if(PlayerInfo[i][pNation] == 0)
				{
					if(arrGroupData[iGroupID][g_iAllegiance] == 1)
					{
						if(arrGroupData[iGroupID][g_iGroupType] == 5)
						{
							new str[128], file[32];
							format(str, sizeof(str), "%s da tra $%s tien thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
							format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
							Log(file, str);
						}
					}
				}
				else if (PlayerInfo[i][pNation] == 1)
				{
					if(arrGroupData[iGroupID][g_iAllegiance] == 2)
					{
						if(arrGroupData[iGroupID][g_iGroupType] == 5)
						{
							new str[128], file[32];
							format(str, sizeof(str), "%s da tra $%s tien thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
							format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
							Log(file, str);
						}
					}
				}
			}
			PlayerInfo[i][pAccount] += interest;
			format(string, sizeof(string), "  Lai thu duoc: $%s", number_format(interest));
			SendClientMessageEx(i, COLOR_GRAD3, string);
			SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
			format(string, sizeof(string), "  Moi-Tien con lai: $%s  |  Tra thue: $%s", number_format(PlayerInfo[i][pAccount]), number_format((0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) ? (HouseInfo[PlayerInfo[i][pRenting]][hRentFee]) : (0)));
			SendClientMessageEx(i, COLOR_GRAD5, string);

			GivePlayerCash(i, PlayerInfo[i][pPayCheck]);
The current paycheck is: 3600 ( level 1 ) , i need change paycheck is: 360 ( level 1 )
Reply
#2

360 what ? Seconds ? Or you want to say that the paycheck gives to players 3600 dollars and you want 360 dollars.
If you mean about the "3600" as seconds just change the:

PHP код:
if( PlayerInfo][ pConnectSeconds ] >= 3600 
With:
PHP код:
if( PlayerInfo][ pConnectSeconds ]  >= 360 
Also, if you want help, make topics more explicit, this is not a explicit topic, i can't really know
about what are you talking, and that code, it's not enough.
Reply
#3

Quote:
Originally Posted by FaLLenGirL
Посмотреть сообщение
360 what ? Seconds ? Or you want to say that the paycheck gives to players 3600 dollars and you want 360 dollars.
If you mean about the "3600" as seconds just change the:

PHP код:
if( PlayerInfo][ pConnectSeconds ] >= 3600 
With:
PHP код:
if( PlayerInfo][ pConnectSeconds ]  >= 360 
Also, if you want help, make topics more explicit, this is not a explicit topic, i can't really know
about what are you talking, and that code, it's not enough.
I need change 3600 dollars to 360 dollars .

Update code :
Код:
foreach(new i: Player)
	{
		if(playerTabbed[i] == 0) {
			switch(PlayerInfo[i][pLevel]) {
				case 0 .. 2: PlayerInfo[i][pPayCheck] += 1;
				case 3 .. 4: PlayerInfo[i][pPayCheck] += 2;
				case 5 .. 6: PlayerInfo[i][pPayCheck] += 3;
				case 7 .. 8: PlayerInfo[i][pPayCheck] += 4;
				case 9 .. 10: PlayerInfo[i][pPayCheck] += 5;
				case 11 .. 12: PlayerInfo[i][pPayCheck] += 6;
				case 13 .. 14: PlayerInfo[i][pPayCheck] += 7;
				case 15 .. 16: PlayerInfo[i][pPayCheck] += 8;
				case 17 .. 18: PlayerInfo[i][pPayCheck] += 9;
				case 19 .. 20: PlayerInfo[i][pPayCheck] += 10;
				default: PlayerInfo[i][pPayCheck] += 11;
			}
			if(++PlayerInfo[i][pConnectSeconds] >= 3600) {
				PayDay(i);
			}
		}
Код:
PayDay(i) {
	new
		string[128],
		interest,
		year,
		month,
		day;

	getdate(year, month, day);

 	if(PlayerInfo[i][pLevel] > 0) {
		if(GetPVarType(i, "debtMsg")) {
			if(GetPlayerCash(i) < 0 && PlayerInfo[i][pJailTime] < 1 && !IsACop(i) && PlayerInfo[i][pWantedLevel] < 6) {
				format(string,sizeof(string),"Ban no $%s - hay tim cach tra lai tien hoac ban se gap rac roi!", number_format(GetPlayerCash(i)));
				SendClientMessageEx(i, COLOR_LIGHTRED, string);
			}
			else DeletePVar(i, "debtMsg");
		}

		if(0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) {
			if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount]) {
				PlayerInfo[i][pRenting] = INVALID_HOUSE_ID;
				SendClientMessageEx(i, COLOR_WHITE, "Ban bi duoi, ban khong co du tien de nop phi thue nha.");
			}
			else {
				HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
				PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
			}
		}
		if(PlayerInfo[i][pConnectSeconds] >= 3600) {
			if(GetPVarType(i, "AdvisorDuty")) {
				PlayerInfo[i][pDutyHours]++;
			}
			if(SpecTimer) AddSpecialToken(i);
			SendClientMessageEx(i, COLOR_WHITE, "________ THONG TIN NGAN HANG ________");
			if(PlayerInfo[i][pNation] == 0)
			{
				format(string, sizeof(string), "  Paycheck: $%s  |  SA Gov Tax: $%s (%d phan tram)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue), TaxValue);
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
				Tax += (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
			}
			else if(PlayerInfo[i][pNation] == 1)
			{
				format(string, sizeof(string), "  Paycheck: $%s  |  TR Gov Tax: $%s (%d phan tram)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
				TRTax += (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
			}
			SendClientMessageEx(i, COLOR_GRAD1, string);
			interest = (PlayerInfo[i][pAccount] + 1) / 1000;

			switch(PlayerInfo[i][pDonateRank]) {
				case 0: {
					if(interest > 50000) interest = 50000;
					format(string, sizeof(string), "  Tien con lai: $%s  |  Lai suat: 0.1 phan tram (50k max)", number_format(PlayerInfo[i][pAccount]));
					SendClientMessageEx(i, COLOR_GRAD1, string);
				}
				case 1: {
					if(interest > 100) interest = 100;
					format(string, sizeof(string), "  Tien con lai: $%s  |  Lai suat: 0.1 phan tram {FFFF00}(Bronze VIP: 100 max)", number_format(PlayerInfo[i][pAccount]));
					SendClientMessageEx(i, COLOR_GRAD1, string);
				}
				case 2:	{
					if(interest > 150) interest = 150;
					format(string, sizeof(string), "  Tien con lai: $%s  |  Lai suat: 0.1 phan tram {FFFF00}(Silver VIP: 150 max)", number_format(PlayerInfo[i][pAccount]));
					SendClientMessageEx(i, COLOR_GRAD1, string);
				}
				case 3: {
					if(interest > 200) interest = 200;
					format(string, sizeof(string), "  Tien con lai: $%s  |  Lai suat: 0.1 phan tram {FFFF00}(Gold VIP: 200 max)", number_format(PlayerInfo[i][pAccount]));
					SendClientMessageEx(i, COLOR_GRAD1, string);
				}
				case 4, 5: {
					if(interest > 250) interest = 250;
					format(string, sizeof(string), "  Tien con lai: $%s  |  Lai suat: 0.1 phan tram {FFFF00}(Platinum VIP: 250 max)", number_format(PlayerInfo[i][pAccount]));
					SendClientMessageEx(i, COLOR_GRAD1, string);
				}
			}
			if(PlayerInfo[i][pTaxiLicense] == 1) {
				PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * 5;
				Tax += (PlayerInfo[i][pPayCheck] / 100) * 5;
				format(string, sizeof(string), "  Le phi bang lai Taxi (5 phan tram): $%s", number_format((PlayerInfo[i][pPayCheck] / 100) * 5));
				SendClientMessageEx(i, COLOR_GRAD2, string);
			}
			for(new iGroupID; iGroupID < MAX_GROUPS; iGroupID++)
			{
				if(PlayerInfo[i][pNation] == 0)
				{
					if(arrGroupData[iGroupID][g_iAllegiance] == 1)
					{
						if(arrGroupData[iGroupID][g_iGroupType] == 5)
						{
							new str[128], file[32];
							format(str, sizeof(str), "%s da tra $%s tien thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
							format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
							Log(file, str);
						}
					}
				}
				else if (PlayerInfo[i][pNation] == 1)
				{
					if(arrGroupData[iGroupID][g_iAllegiance] == 2)
					{
						if(arrGroupData[iGroupID][g_iGroupType] == 5)
						{
							new str[128], file[32];
							format(str, sizeof(str), "%s da tra $%s tien thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
							format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
							Log(file, str);
						}
					}
				}
			}
			PlayerInfo[i][pAccount] += interest;
			format(string, sizeof(string), "  Lai thu duoc: $%s", number_format(interest));
			SendClientMessageEx(i, COLOR_GRAD3, string);
			SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
			format(string, sizeof(string), "  Moi-Tien con lai: $%s  |  Tra thue: $%s", number_format(PlayerInfo[i][pAccount]), number_format((0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) ? (HouseInfo[PlayerInfo[i][pRenting]][hRentFee]) : (0)));
			SendClientMessageEx(i, COLOR_GRAD5, string);

			GivePlayerCash(i, PlayerInfo[i][pPayCheck]);
Reply
#4

you must change value of PlayerInfo[i][pPayCheck]
Reply
#5

Quote:
Originally Posted by Mugala
Посмотреть сообщение
you must change value of PlayerInfo[i][pPayCheck]
how to change value of PlayerInfo[i][pPayCheck] ?
Reply
#6

Код:
if(PlayerInfo[i][pConnectSeconds] >= 3600)
- This is 60 minutes that means you get the paycheck every hour.

to change the paycheck you have to

you have to play with the "100" after the

PHP код:
else if(PlayerInfo[i][pNation] == 1)
            {
                
format(stringsizeof(string), "  Paycheck: $%s  |  TR Gov Tax: $%s (%d phan tram)"number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
                
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
                
TRTax += (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
            }
            
SendClientMessageEx(iCOLOR_GRAD1string);
            
interest = (PlayerInfo[i][pAccount] + 1) / 1000 
you also need to change the intrest rate from 1000 to 100 if you want to change it rate is not as I can see 100,000 and you get 1,000 intrest

* is the value so try to change the 100 to 200
Reply
#7

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
Код:
if(PlayerInfo[i][pConnectSeconds] >= 3600)
- This is 60 minutes that means you get the paycheck every hour.

to change the paycheck you have to

you have to play with the "100" after the

PHP код:
else if(PlayerInfo[i][pNation] == 1)
            {
                
format(stringsizeof(string), "  Paycheck: $%s  |  TR Gov Tax: $%s (%d phan tram)"number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
                
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
                
TRTax += (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
            }
            
SendClientMessageEx(iCOLOR_GRAD1string);
            
interest = (PlayerInfo[i][pAccount] + 1) / 1000 
you also need to change the intrest rate from 1000 to 100 if you want to change it rate is not as I can see 100,000 and you get 1,000 intrest

* is the value so try to change the 100 to 200
I tried change 1000 to 100, but still not
Reply
#8

Try this
PHP код:
else if(PlayerInfo[i][pNation] == 0)
            {
                
format(stringsizeof(string), "  Paycheck: $%s  |  Gov Tax: $%s (%d phan tram)"number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 50) * TaxValue), TaxValue);
                
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
                
Tax += (PlayerInfo[i][pPayCheck] / 50) * TaxValue;
            }
            
SendClientMessageEx(iCOLOR_GRAD1string);
            
interest = (PlayerInfo[i][pAccount] + 1) / 10 
Reply
#9

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
Try this
PHP код:
else if(PlayerInfo[i][pNation] == 0)
            {
                
format(stringsizeof(string), "  Paycheck: $%s  |  Gov Tax: $%s (%d phan tram)"number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 50) * TaxValue), TaxValue);
                
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
                
Tax += (PlayerInfo[i][pPayCheck] / 50) * TaxValue;
            }
            
SendClientMessageEx(iCOLOR_GRAD1string);
            
interest = (PlayerInfo[i][pAccount] + 1) / 10 
Thank you help me, the money received is $ 360
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)