[HELP] Eject people from police vehicle
#1

Hi

I need a script to eject people thats enter the police car.
they may enter the car as by driver but not as driver.
A cop may enter the car as driver.
Have someone here a FS for? are something?
Reply
#2

maybe you can use that logic

if player isn't police skin eject him/her
Reply
#3

Yes thats what i want but , it need to be eject when he would steals the car
can you give that ?
Reply
#4

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{  
  if(newstate == PLAYER_STATE_DRIVER) // if the new state of a player is driver then continue
  {
    if(GetVehicleModel(GetPlayerVehicleID(playerid) == 596)) // if the vehicle the player is stepping into is 596 (LSPD CAR)
    {
      RemovePlayerFromVehicle(playerid); // remove the player from the vehicle
      return 1;
    }
  }
  return 1;
}
This is just a simple example, ofcourse you will have to edit it. For a list of vehicles model id's goto: https://sampwiki.blast.hk/wiki/Category:Vehicle
Reply
#5

dont work can you make it in a filter script and then betteR?
te police car needs only eject normal players , cops can only into it

would you do that?
Reply
#6

Ofcourse it wont work fully, this will kick anyone out who enters a cop car, like I said you will need to edit it.. I don't know how teams are defined in your gamemode so I can't help you any further..
Reply
#7

Quote:
Originally Posted by Sneaky.
Ofcourse it wont work fully, this will kick anyone out who enters a cop car, like I said you will need to edit it.. I don't know how teams are defined in your gamemode so I can't help you any further..
I use the penls maybe you know it ?
Reply
#8

Quote:
Originally Posted by baxi
Quote:
Originally Posted by Sneaky.
Ofcourse it wont work fully, this will kick anyone out who enters a cop car, like I said you will need to edit it.. I don't know how teams are defined in your gamemode so I can't help you any further..
I use the penls maybe you know it ?
Yes I know it, in pen1 "TEAM_BLUE" is the copteam and "gTeam" is the player variable where the team gets stored it, so you will have to edit my code and do this:

pawn Код:
if(gTeam[playerid] != TEAM_BLUE) // != means IS NOT so if the team is NOT the cop team then continue
Please try to edit this on your own, if you really can't figure it out then post here
Reply
#9

RemovePlayerFromVehicle doesn't work, it just plays the exit animation and nothing else. Use SetPlayerPos
Reply
#10

Quote:
Originally Posted by dice7
RemovePlayerFromVehicle doesn't work, it just plays the exit animation and nothing else. Use SetPlayerPos
Then you obviously did something wrong because it works fine..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)