17.08.2016, 09:13
You need an
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
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.
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!
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];