SA-MP Forums Archive
[HELP]Job Payment. - 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: [HELP]Job Payment. (/showthread.php?tid=289072)



[HELP]Job Payment. - Qaiis - 10.10.2011

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!


Re: [HELP]Job Payment. - Camacorn - 10.10.2011

Код:
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);
}



Re: [HELP]Job Payment. - Hal - 10.10.2011

Put your timer in a callback that actually has playerid.

Read some articles on the timer function to learn how to use it properly.
https://sampwiki.blast.hk/wiki/SetTimerEx


Re: [HELP]Job Payment. - Qaiis - 10.10.2011

Quote:
Originally Posted by Camacorn
Посмотреть сообщение
Код:
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?


Re: [HELP]Job Payment. - TheLazySloth - 10.10.2011

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.


Re: [HELP]Job Payment. - Qaiis - 10.10.2011

Thank You guys. Everything working! ^^