[HELP]Job Payment.
#1

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

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

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
Reply
#4

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?
Reply
#5

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.
Reply
#6

Thank You guys. Everything working! ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)