SA-MP Forums Archive
Salary by profession! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Salary by profession! (/showthread.php?tid=616590)



Salary by profession! - TheM4st3r - 07.09.2016

Hello gentlemen, I wonder how can I make a salary system by profession?

variable of profession

pawn Код:
if(PlayerInfo[playerid][courier] == 1)
40 in 40 minutes

thanks


Re: Salary by profession! - JordanZaundd - 07.09.2016

As in each payday, depending on the job you want them to receive different amounts of cash? If that's the case, then:
PHP код:
//Declare person's salery based on job.
if(PlayerInfo[playerid][courier] == 1)
    
PlayerInfo[playerid][pPayday] = changeme;
if(
PlayerInfo[playerid][pizzaboy] == 1)
    
PlayerInfo[playerid][pPayday] = changeme;
//...continue for how many jobs you have.
//On payday..
GivePlayerMoney(playeridPlayerInfo[playerid][pPayday]); 



Re: Salary by profession! - TheM4st3r - 07.09.2016

Quote:
Originally Posted by JordanZaundd
Посмотреть сообщение
As in each payday, depending on the job you want them to receive different amounts of cash? If that's the case, then:
PHP код:
//Declare person's salery based on job.
if(PlayerInfo[playerid][courier] == 1)
    
PlayerInfo[playerid][pPayday] = changeme;
if(
PlayerInfo[playerid][pizzaboy] == 1)
    
PlayerInfo[playerid][pPayday] = changeme;
//...continue for how many jobs you have.
//On payday..
GivePlayerMoney(playeridPlayerInfo[playerid][pPayday]); 
In the case of this profession the salary would be 800


Re: Salary by profession! - JordanZaundd - 07.09.2016

Quote:
Originally Posted by TheM4st3r
Посмотреть сообщение
In the case of this profession the salary would be 800
I have put all the variables that you need to change to the payday values as 'changeme'

PHP код:
//So then you would change the 'changeme' in:
if(PlayerInfo[playerid][courier] == 1
    
PlayerInfo[playerid][pPayday] = changeme;
//to look like..
if(PlayerInfo[playerid][courier] == 1
    
PlayerInfo[playerid][pPayday] = 800