Destroy Current Vehicles Help
#9

You need an
PHP код:
if(currentvehicle)
{
DestroyVehicle(currentvehicle);

PHP код:
//new currentveh;   <<<<<Not Work Good! because you shouldn't do this...
                        //currentveh = GetPlayerVehicleID(playerid); //<<<<<Not Work Good! 
if(currentvehicle[playerid])
{
DestroyVehicle(currentvehicle[playerid]);
}
                        
//DestroyVehicle(currentveh);   //<<<<<Not Work Good! 
before you create the next one.

currentvehicle will only work for the one, so if another person makes a new vehicle, it'll wipe out whoevers vehicle was last made.

You need it to be an array
PHP код:
new currentvehicle[MAX_PLAYERS]; 
up top of the script, not in the middle. Otherwise when one person uses it, there'll only be one vehicle ever spawned, no matter who uses the command.
Reply


Messages In This Thread
Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 08:23
Re: Destroy Current Vehicles Help - by Sew_Sumi - 16.08.2016, 08:56
Re: Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 09:17
Re: Destroy Current Vehicles Help - by Sew_Sumi - 16.08.2016, 12:25
Re: Destroy Current Vehicles Help - by alishvasis - 16.08.2016, 12:29
Re: Destroy Current Vehicles Help - by Shinja - 16.08.2016, 13:42
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 07:57
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 09:01
Re: Destroy Current Vehicles Help - by Sew_Sumi - 17.08.2016, 09:13
Re: Destroy Current Vehicles Help - by alishvasis - 17.08.2016, 09:20

Forum Jump:


Users browsing this thread: 1 Guest(s)