PDA

View Full Version : [HELP]Job Payment.


Qaiis
10/10/2011, 12:11 AM
Hello.!
How can i go do so only the job with ID 1 get the money?
I got this:
public OnGameModeInit()
{
SetTimer("PayTimer",5000,true);
return 1;
}


Then i got this:
public PayTimer(playerid)
{
if(GetPlayerJobID(playerid)!=1)
GivePlayerMoney(playerid,300);
}

Its give money to all players. You dont need to be in an job!

Its not working. Can you please help me? And how can i add an job with an other payment?

Thank You!

Camacorn
10/10/2011, 12:20 AM
public PayTimer(playerid)
{
if(GetPlayerJobID(playerid)!=1)
GivePlayerMoney(playerid,300);
}

Right here you have it defined to give anybody that does not have ID 1 the money.

Use this:


public PayTimer(playerid)
{
if(GetPlayerJobID(playerid)==1)
GivePlayerMoney(playerid,300);
}

Hal
10/10/2011, 12:22 AM
Put your timer in a callback that actually has playerid.

Read some articles on the timer function to learn how to use it properly.
http://wiki.sa-mp.com/wiki/SetTimerEx

Qaiis
10/10/2011, 12:34 AM
public PayTimer(playerid)
{
if(GetPlayerJobID(playerid)!=1)
GivePlayerMoney(playerid,300);
}

Right here you have it defined to give anybody that does not have ID 1 the money.

Use this:


public PayTimer(playerid)
{
if(GetPlayerJobID(playerid)==1)
GivePlayerMoney(playerid,300);
}


Thank you!
But how can i add payment on job ID 2?

TheLazySloth
10/10/2011, 12:48 AM
if(GetPlayerJobID(playerid)==2)
GivePlayerMoney(playerid,600);

add that under

if(GetPlayerJobID(playerid)==1)
GivePlayerMoney(playerid,300);

change the 600 to whatever the increase is.

Qaiis
10/10/2011, 01:06 AM
Thank You guys. Everything working! ^^