Help please! [ SOLVED ] [ HOW TO FIX INSIDE ] - 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 please! [ SOLVED ] [ HOW TO FIX INSIDE ] (
/showthread.php?tid=83747)
Help please! [ SOLVED ] [ HOW TO FIX INSIDE ] -
coole210 - 26.06.2009
Okay i got this job include and i implemented it to my gamemode.
How do i make it so if they try to spawn as TEAM_POLICE and they are not a cop they get kicked?
Here's what i got so far (i didn't even really start) :
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerJobID == 1)
{
//if there not police (ID 1) they should get kicked, if they are on TEAM_POLICE and there job ID is 1 they are allowed to spawn without being kicked. So what do i put here?
}
return 1;
}
Re: Help please! -
shady91 - 26.06.2009
pawn Код:
public OnPlayerSpawn(playerid)
{
if(make it read player info == 1)
{
//make it spawn cops with cops class id
}
if(GetPlayerJobID < 2)
{
//SendClientMessage(playerid, COLOR_GREY, " your not a cop"); u can use instead of kick
kick(playerid)
return 1;
}
pawn Код:
public SetPlayerTeamFromClass(playerid,classid)
{
if(classid >= 286)
{
gTeam[playerid] = TEAM_COPS;
}
Код:
add at the bottem of on player request class add this is here
SetPlayerTeamFromClass(playerid,classid);
and forward this mate
pawn Код:
forward SetPlayerTeamFromClass(playerid,classid);
Re: Help please! -
coole210 - 26.06.2009
Nice try, That just kicks somebody that spawns as job 1..
Re: Help please! -
shady91 - 26.06.2009
o you want it so if there police they spawn and if not they get kicked?
Re: Help please! -
coole210 - 26.06.2009
I want it so if there Job ID 1 they can spawn as TEAM_POLICE or else they get kicked
Re: Help please! -
shady91 - 26.06.2009
o ok check my previous post i edited it mate.
Re: Help please! -
coole210 - 27.06.2009
I don't get your edited post AT ALL.
Can you just make full example of a script in .pwn or can somebody else help me?
You're post doesn't give enough information that i can follow. and whats with the classid > 286?
Re: Help please! -
shady91 - 27.06.2009
o thats part from my script you replace that to your class ids
Re: Help please! -
shady91 - 27.06.2009
is that more clear mate? check previous post
Re: Help please! -
Grim_ - 27.06.2009
Something like this, building off of your first post example:
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerJobID == 1 && gTeam[playerid] != TEAM_POLICE) // if they're cop job and their team ISN'T police.
{
SendClientMessage(playerid, color, "You are not allowed to spawn with the police force while not being a police officer!");
Kick(playerid);
return 1;
}
return 1;
}