Help (vehicle)
#1

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

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

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
Reply
#4

nvm i got it.
Reply
#5

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

Show your code.
Reply
#7

Here's my OnPlayerEnterVehicle:

http://pastebin.com/m54a11da6
Reply
#8

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

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)
{
..
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)