SA-MP Forums Archive
Help (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 (vehicle) (/showthread.php?tid=83941)



Help (vehicle) - coole210 - 27.06.2009

OKAY SO I HAVE JOBS...

How do i make it so that they can't enter a car that's not specified to their team?

For example, TEAM_HITMAN has 1 team car, ID 405 sentinel. if there not hitman they aren't allowed to enter the car. I play on this server, official, [FR - EN] Permenant West-Side RPG and if you try to enter a security guard car without being security guard it does a glitchy walk and others see you enter, but you really don't! So how do i make it so that there locked in [FR - EN] Permenant West-Side RPG or if there just locked in a SetVehicleParamsForPlayer type of way


Re: Help (vehicle) - Correlli - 27.06.2009

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new Float:x_pos, Float:y_pos, Float:z_pos;
  if(vehicleid == _VEHICLE_ID_YOU_WANT_)
  {
  if(!__PLAYER_TEAM_DEFINE_[playerid])
  {
  GetPlayerPos(playerid, x_pos, y_pos, z_pos);
  SetPlayerPos(playerid, x_pos, y_pos, z_pos);
  SendClientMessage(playerid, 0xFFFFFFAA, "You can't enter this vehicle, you're not in the correct team!");
  }
  else
  {
  SendClientMessage(playerid, 0xFFFFFFAA, "Welcome!");
  }
  }
  return 1;
}



Re: Help (vehicle) - coole210 - 28.06.2009

Okay it works (no warnings, haven't tested) but how do i make 1 car only enterable by 3 different teams? like ID 596 is only enterable by TEAM_SWAT TEAM_POLICE TEAM_SG


Re: Help (vehicle) - coole210 - 28.06.2009

nvm i got it.


Re: Help (vehicle) - coole210 - 28.06.2009

TESTED and It's not working, can somebody help me out again?


Re: Help (vehicle) - Correlli - 28.06.2009

Show your code.


Re: Help (vehicle) - coole210 - 28.06.2009

Here's my OnPlayerEnterVehicle:

http://pastebin.com/m54a11da6


Re: Help (vehicle) - coole210 - 28.06.2009

Hello? You asked for the script and i showed then you left lol....


Re: Help (vehicle) - Correlli - 28.06.2009

Quote:
Originally Posted by coole210
Hello? You asked for the script and i showed then you left lol....
I can't hang on forums all the time, i have my life also.
And you understood it wrong, you disabled the team to enter it.

pawn Код:
if(gTeam[playerid] == TEAM_HITMAN)
{
..
}
should be like:
pawn Код:
if(gTeam[playerid] != TEAM_HITMAN)
{
..
}



Re: Help (vehicle) - coole210 - 28.06.2009

Thats not it either, i just tested and it just says now, YOU HAVE BEEN CARJACKED!, when they steal cars MY TEAM CAR from me..