SA-MP Forums Archive
CARS + TEAMS - 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: CARS + TEAMS (/showthread.php?tid=64673)



CARS + TEAMS - kLx - 06.02.2009

Ok, need some help.

I am creating jobs system, and i need, that only COPS can drive COP cars, and else, GANGS only the CARS i want..

I have defined the teams, so what i need to do next?

When a civilian (who hasnt got a job) enters a COP car, that is
pawn Код:
AddStaticVehicle(598,-228.5587,990.8199,19.2583,269.6946,0,1); // PD
He automaticaly exits the car..
Thats what i need.



Re: CARS + TEAMS - Soeren - 06.02.2009

You can do it like this, it's how I handle it. There are more options but this works fine for me:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger) // Let others still enter the car as passenger, delete if you don't want that
    {
      if(GetVehicleModel(vehicleid) == 596) // The Vehicle-Model, change it to whatever you like
      {
         if(gTeam[playerid] != TEAM_COPS) // However you have defined your Team
         {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            SetPlayerPos(playerid, X, Y, Z);
            SendClientMessage(playerid,0x63AFF00A,"You are not a Cop!");
          }
      }
    }
}

Hope I could help you!


Re: CARS + TEAMS - ICECOLDKILLAK8 - 06.02.2009

I dont use OnPlayerEnterVehicle i use OnPlayerStateChange

pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == w/e model)
{
if(gTeam[playerid] != Team_Cop)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, w/e color, "You are not a cop");
return 1;
}
}
}
return 1;
}



Re: CARS + TEAMS - kLx - 07.02.2009

I don't need this..
It's for all vehicles of that model, and I need, that on specified vehicle would be for only cops.

because some gangs and mafias has the same vehicles..
and if i define car sabre only for egz. team_bebrai ,and if other team (egz. team_kolukis) has the same vehicle, it will be for team_bebrai..
That sux !

If someone understand me, it would be great


Re: CARS + TEAMS - kLx - 07.02.2009

Oh, i made it by myself,

Thanks, who tried to help.


Re: CARS + TEAMS - Peter_Corneile - 10.04.2009

Bro can you send the code that you made yourself please ?!


Re: CARS + TEAMS - Taz86 - 10.04.2009

Yes but i want to make it not just one car.
couple of cars

How to make it?