SA-MP Forums Archive
Mass function - 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: Mass function (/showthread.php?tid=582059)



Mass function - alexanderjb918 - 17.07.2015

Okay so this is my job code
Код:
#define JOB_COURIER (1)
#define JOB_MECHANIC (2)
#define JOB_TAXI (3)
#define JOB_UNLOADER (4)
#define JOB_MINER (5)
#define JOB_FOOD_VENDOR (6)
#define JOB_GARBAGE (7)
#define JOB_SORTER (8)
#define JOB_WEAPON_SMUGGLER (9)
how can i put this into a function so JOB_ALL = all jobs listed above?
Код:
	        if (PlayerData[playerid][pJob] != JOB_ALL)
			return SendErrorMessage(playerid, "You don't have the appropriate job.");



Re: Mass function - Vince - 17.07.2015

Perhaps you should just do the opposite and define JOB_NONE as being 0.


Re: Mass function - Abagail - 17.07.2015

You can do what Vince said, and make anything more than 0 a job - a very easy method, or you can make a define that checks if the jobid is 1-9.


Re: Mass function - alexanderjb918 - 17.07.2015

Yea thanks I did what vince said