SA-MP Forums Archive
Make cars entrable for certin team? - 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: Make cars entrable for certin team? (/showthread.php?tid=137395)



Make cars entrable for certin team? - hardstop - 28.03.2010

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


Re: Make cars entrable for certin team? - ScottCFR - 28.03.2010

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



Re: Make cars entrable for certin team? - [MWR]Blood - 28.03.2010

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


Re: Make cars entrable for certin team? - ScottCFR - 28.03.2010

Yeah.


Re: Make cars entrable for certin team? - [HiC]TheKiller - 28.03.2010

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;
}



Re: Make cars entrable for certin team? - Norck - 28.03.2010


Код:
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;
}



Re: Make cars entrable for certin team? - hardstop - 30.03.2010

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.