CARS + TEAMS
#1

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

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!
Reply
#3

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

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

Oh, i made it by myself,

Thanks, who tried to help.
Reply
#6

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

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

How to make it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)