Vehicle ID
#6

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
That's because you've never used it in your script, once you use it somewhere, it'll work, i.e.:

pawn Код:
new car1;

public OnGameModeInit()
{
   car1 = CreateVehicle(...);
   return 1;
}
This will return that warning 204.

pawn Код:
new car1;

public OnGameModeInit()
{
   car1 = CreateVehicle(...);
   return 1;
}

public OnPlayerUpdate(playerid)
{
   if(GetPlayerVehicleID(playerid) == car1) return RemovePlayerFromVehicle(playerid);
   return 1;
}
Now the value of car1 has been used here, so it won't return any errors / warnings.
You could just simple use OnPlayerEnterVehicle or OnPlayerStateChange

Example
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) == car1)  return RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
Reply


Messages In This Thread
Vehicle ID - by MrMou6 - 05.10.2013, 10:51
Re: Vehicle ID - by RajatPawar - 05.10.2013, 10:55
Re: Vehicle ID - by MrMou6 - 05.10.2013, 11:23
Re: Vehicle ID - by RajatPawar - 05.10.2013, 11:28
Re: Vehicle ID - by DanishHaq - 05.10.2013, 11:28
Re: Vehicle ID - by Patrick - 05.10.2013, 11:33

Forum Jump:


Users browsing this thread: 1 Guest(s)