SA-MP Forums Archive
Jobs? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Jobs? (/showthread.php?tid=88823)



Jobs? - Anthony413 - 29.07.2009

Okay well on my gamemode I am extremely puzzled on this bit. I want to make it so when the players spawn as a civilian, they pick their job by a menu. I've already made the menu but how do I make it so when they choose a job, it sets them on a team and spawns them where the team should spawn?

Is there a SetPlayerOnTeam function or something similar to that?


Re: Jobs? - matdav - 29.07.2009

you probably want SetPlayerTeam(playerid,team);


Re: Jobs? - Anthony413 - 29.07.2009

Quote:
Originally Posted by matdav
you probably want SetPlayerTeam(playerid,team);
Thank you so much. Can't believe I didn't see it in the functions list in pawno. :S



Re: Jobs? - Abernethy - 29.07.2009

Why are you using teams for a Job lol? Make a variable.


Re: Jobs? - Anthony413 - 29.07.2009

Quote:
Originally Posted by Abernethy
Why are you using teams for a Job lol? Make a variable.
I also have commands and areas for each job but how would I make a variable for each job?


Re: Jobs? - pagie1111 - 29.07.2009

Above OnGameModeInit:
Код:
new JobCop[MAX_PLAYERS];
when they select the job of "Cop" add to the script:

Код:
JobCop[playerid] = 1;
any commands they use, use this:

Код:
if(JobCop[playerid] == 1)
{
//Enter script
return 1;
}
when they leave that job:

Код:
JobCop[playerid] = 0;
Change Cop to any job you have. Also for every job you make use in OnPlayerConnect:

Код:
JobCop[playerid] = 0;