SA-MP Forums Archive
[HELP] Eject people from police vehicle - 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] Eject people from police vehicle (/showthread.php?tid=85257)



[HELP] Eject people from police vehicle - baxi - 06.07.2009

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?


Re: [HELP] Eject people from police vehicle - ByFukara - 06.07.2009

maybe you can use that logic

if player isn't police skin eject him/her


Re: [HELP] Eject people from police vehicle - baxi - 06.07.2009

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


Re: [HELP] Eject people from police vehicle - -Sneaky- - 06.07.2009

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


Re: [HELP] Eject people from police vehicle - baxi - 06.07.2009

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?


Re: [HELP] Eject people from police vehicle - -Sneaky- - 06.07.2009

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..


Re: [HELP] Eject people from police vehicle - baxi - 06.07.2009

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 ?


Re: [HELP] Eject people from police vehicle - -Sneaky- - 06.07.2009

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


Re: [HELP] Eject people from police vehicle - dice7 - 06.07.2009

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


Re: [HELP] Eject people from police vehicle - -Sneaky- - 06.07.2009

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..