SA-MP Forums Archive
Help with 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: Help with jobs. (/showthread.php?tid=83616)



Help with jobs. - coole210 - 26.06.2009

Well i found this job include and i decided to put it in my gamemode. No errors or warnings but how do i make it so that if they are job 1 and they are logged in they automatically spawn as TEAM_COP?

Here's what i got so far ( OnPlayerSpawn ) :

pawn Код:
if(GetPlayerJobID(playerid) == 1)
    {
        SetPlayerSkin(playerid,skincop);
    }
That just changes them to the skin, I don't want that, i want it to MAKE them go into the gTeam TEAM_POLICE

How do i do this? ( if there are any problems with the script i'm showing you now, please change in a reply)



Re: Help with jobs. - brett7 - 26.06.2009

SetPlayerTeam(playerid, TEAM_POLICE);



Re: Help with jobs. - coole210 - 26.06.2009

Quote:
Originally Posted by brett7
SetPlayerTeam(playerid, TEAM_POLICE);
Does that FORCE them into spawn right away as TEAM_POLICE? or does it just set them to the team?


Re: Help with jobs. - brett7 - 26.06.2009

i think it just sets them then you could SpawnPlayer(playerid);


Re: Help with jobs. - coole210 - 26.06.2009

I need it to force them in on spawn !


Re: Help with jobs. - coole210 - 26.06.2009

does anybody know how to force it or should this work ?

pawn Код:
if(GetPlayerJobID(playerid) == 1)
{
    SetPlayerTeam(playerid,TEAM_POLICE);
    SpawnPlayer(playerid);
return 1;
}



Re: Help with jobs. - coole210 - 26.06.2009

Omg Tested the script above and when i choose any class it just KEEPS spawning.

How to fix? do i have to add a function like this to my gClass's?

pawn Код:
if(GetPlayerJobID(playerid) == 1)
{
SendClientMessage(playerid,COLOR_GREEN,"You are a cop, choose the cop skin!");
else }
kick(playerid);
(I have not added/tested this script, i'm 100% sure it does NOT work) can anybody post a script ?

I use the normal gClasses from the 'How to make a TDM' tutorial.