Vehicle for specific player
#7

PHP код:
new PlayerIDCar[MAX_VEHICLES];
new 
playercar[MAX_PLAYERS]; 
playercar[playerid] = CreateVehicle(411,0,0,0,2,-1,-1,3600);
PlayerIDCar[playercar[playerid] ] = playerid
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger

  if(
vehicleid==playercar[playerid])
  {
    
SendClientMessage(playerid,-1,This is your car!);
  }
  else
  {
   new 
str[128];
   
format(str,sizeof(str),"This car is owned by %s",PlayerName(PlayerIDCar[vehicleid ] ) )
  
SendClientMessage(playerid,-1,str);
  }

And don't forget to destroy the car

OnPlayerDisconnect(playerid)
{
if(IsValidVehicle(playercar[playerid])
DestroyVehicle(playercar[playerid]);
}
Reply


Messages In This Thread
Vehicle for specific player - by Supermaxultraswag - 14.09.2015, 17:04
AW: Vehicle for specific player - by Nero_3D - 14.09.2015, 18:43
Re : Vehicle for specific player - by KillerDVX - 14.09.2015, 22:38
Re: Vehicle for specific player - by Supermaxultraswag - 18.09.2015, 15:25
Re: Vehicle for specific player - by Mister0 - 18.09.2015, 15:30
Re: Vehicle for specific player - by Supermaxultraswag - 18.09.2015, 15:33
Re: Vehicle for specific player - by Mister0 - 18.09.2015, 15:45
Re: Vehicle for specific player - by rappy93 - 18.09.2015, 15:46
Re: Vehicle for specific player - by Jefff - 18.09.2015, 15:47
Re: Vehicle for specific player - by Supermaxultraswag - 03.10.2015, 12:47

Forum Jump:


Users browsing this thread: 3 Guest(s)