Help please! [ SOLVED ] [ HOW TO FIX INSIDE ]
#1

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;
}
Reply
#2

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);
Reply
#3

Nice try, That just kicks somebody that spawns as job 1..
Reply
#4

o you want it so if there police they spawn and if not they get kicked?
Reply
#5

I want it so if there Job ID 1 they can spawn as TEAM_POLICE or else they get kicked
Reply
#6

o ok check my previous post i edited it mate.
Reply
#7

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

o thats part from my script you replace that to your class ids
Reply
#9

is that more clear mate? check previous post
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)