Make cars entrable for certin team?
#1

I have these teams

#define TEAM_POLICE
#define TEAM_MEDIC


and i how can i make that if medic enters police car so that he cant drive

like team has own cars and only team members can enter
Reply
#2

Under OnPlayerEnterVehicle. Look to see it the car is a ambulance, and see which team is entering.
Reply
#3

Quote:
Originally Posted by ScottCFR
Under OnPlayerEnterVehicle. Look to see it the car is a ambulance, and see which team is entering.
He should use gTeam
Reply
#4

Yeah.
Reply
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(gTeam[playerid] == TEAM_MEDIC && vehicleid == /*Put one of the cop cars vehicle ID's here*/)
  {
     new Pos[3];
     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
     SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
     SendClientMessage(playerid, COLOR, "This is a police team vehicle!!");
  }
  return 1;
}
Reply
#6


Код:
new Pos[3];
Should be
Код:
new Float:Pos[3];
So it will looks like:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(gTeam[playerid] == TEAM_MEDIC && vehicleid == /*Put one of the cop cars vehicle ID's here*/)
  {
     new Float:Pos[3];
     GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
     SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
     SendClientMessage(playerid, COLOR, "This is a police team vehicle!!");
  }
  return 1;
}
Reply
#7

Il try it

Edited later result:

got these errors

Код:
C:\DOCUME~1\Andrus\Desktop\ANDRUS~1\GAMEMO~1\rp.pwn(1162) : error 028: invalid subscript (not an array or too many subscripts): "gTeam"
C:\DOCUME~1\Andrus\Desktop\ANDRUS~1\GAMEMO~1\rp.pwn(1162) : warning 215: expression has no effect
C:\DOCUME~1\Andrus\Desktop\ANDRUS~1\GAMEMO~1\rp.pwn(1162) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\Andrus\Desktop\ANDRUS~1\GAMEMO~1\rp.pwn(1162) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Andrus\Desktop\ANDRUS~1\GAMEMO~1\rp.pwn(1162) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)