Class = Car?!
#1

Ok how would i identify if a player is in thier "Teams" vehicle. Something like:

Код:
If(IsPlayergTeam(playerid) == TEAM_POLICE)
{
    IsPLayerInAnyVehicle(playerid)
    {
That's kinda how i think it might be setup
Reply
#2

Are the team cars different? For example, a Sultan is for team "x" while a Huntley is for the other team?
Reply
#3

Well, you can create a function to check if a vehicle is of a team by vehicle id's.
Example:
pawn Код:
forward IsAGrooveCar(carid);
public IsAGrooveCar(carid)
{
    if((carid>= 4) && (carid<= 6)){return 1;}
  return 0;
}
Then, in on PlayerStateChange callback:
pawn Код:
new carid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
 if(IsAGrooveCar(carid))
 {
 //Do something
 }
Reply
#4

Quote:
Originally Posted by Dococ
Are the team cars different? For example, a Sultan is for team "x" while a Huntley is for the other team?
Well i want to set them so "Drug Dealers" can't enter SFPD only the Police can.
also so Police can't enter "Drug Dealers" cars.
Reply
#5

Quote:
Originally Posted by ScottCFR
Quote:
Originally Posted by Dococ
Are the team cars different? For example, a Sultan is for team "x" while a Huntley is for the other team?
Well i want to set them so "Drug Dealers" can't enter SFPD only the Police can.
also so Police can't enter "Drug Dealers" cars.
Quote:
Originally Posted by Zimon95
Well, you can create a function to check if a vehicle is of a team by vehicle id's.
Example:
pawn Код:
forward IsAGrooveCar(carid);
public IsAGrooveCar(carid)
{
    if((carid>= 4) && (carid<= 6)){return 1;}
  return 0;
}
Then, in on PlayerStateChange callback:
pawn Код:
new carid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
 if(IsAGrooveCar(carid))
 {
 //Do something
 }
Reply
#6

Quote:
Originally Posted by Zimon95
Well, you can create a function to check if a vehicle is of a team by vehicle id's.
Example:
pawn Код:
if((carid>= 4) && (carid<= 6)){return 1;}
  return 0;
Do i go by model in SA-MP or the order they are in my server?
Reply
#7

They go by the order in your script, so the first AddStaticVehicle is ID 1, and so on...
Reply
#8

Quote:
Originally Posted by Zimon95
They go by the order in your script, so the first AddStaticVehicle is ID 1, and so on...
Ok, Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)