Vehicles variable
#1

Hello! I got a problem with variable, which I want to add to multiple cars.
Like this:
PHP код:
new Variable[MAX_VEHICLES];
public 
OnGameModeInIt()
{
      
Variable[1] = CreateVehicle(....................................);
      
Variable[2] = CreateVehicle(....................................);
      return 
1;
}
public 
OnPlayerStateChange(playeridoldstatenewstate)
{
      if(
newstate == PLAYER_STATE_DRIVER)
      {
             if(
GetPlayerVehicleID(playerid)==Variable[all the cars with Variable]) // I just want to not write this line with Variable[number, for example - 1] for multiple times, I want this in one line like I wrote under if(newstate == ....)
             
{
                    
// Function
             
}
      }

I hope you will help me, thanks!
Reply


Messages In This Thread
Vehicles variable - by Armands - 15.12.2012, 08:21
Re: Vehicles variable - by FTLOG - 15.12.2012, 08:55
Re: Vehicles variable - by Armands - 15.12.2012, 09:27
Re: Vehicles variable - by Armands - 15.12.2012, 10:15
Re: Vehicles variable - by FTLOG - 15.12.2012, 10:18
Re: Vehicles variable - by Armands - 15.12.2012, 10:50

Forum Jump:


Users browsing this thread: 2 Guest(s)