removing the last spawned vehicle after spawning the new one
#2

ye for that u will be needing a variable / a array:
a example ::-
<in command or place where player spawn vehicle>
pawn Код:
if( pVehicleSpawned[playerid] != -1 ) // this variable need to be set to -1 at player connect or at any other place required
{
    for( new i; i < MAX_PLAYERS; i++ )
    {
          if( IsPlayerInVehicle( i,  pVehicleSpawned[playerid] ) DestroyVehicle( pVehicleSpawned[playerid] );// will delete vehicle id the playerid had spawned earlier if it is not occupied by anyone
    }
}
pVehicleSpawned[playerid] = CreateVehicle(...); // create new vehicle and store vehicleid as seen by server in the variable..for playerid
//end
i made a fs which come with some similar example:
see its part where i createvehicle: http://************/79ltguu
Reply


Messages In This Thread
removing the last spawned vehicle after spawning the new one - by absolute - 01.03.2013, 09:16
Re: removing the last spawned vehicle after spawning the new one - by Niko_boy - 01.03.2013, 09:23
Re: removing the last spawned vehicle after spawning the new one - by absolute - 01.03.2013, 09:31
Re: removing the last spawned vehicle after spawning the new one - by Niko_boy - 01.03.2013, 12:27
Re: removing the last spawned vehicle after spawning the new one - by absolute - 01.03.2013, 13:00

Forum Jump:


Users browsing this thread: 1 Guest(s)