if(CurrentSpawnedVehicle[playerid] != -1) { DestroyVehicle(CurrentSpawnedVehicle[playerid]); }
CreateVehicleEx(playerid,582, X,Y,Z+1, Angle, random(126), random(126), -1);
stock CreateVehicleEx(playerid, modelid, Float:posX, Float:posY, Float:posZ, Float:angle, Colour1, Colour2, respawn_delay) { new world = GetPlayerVirtualWorld(playerid); new interior = GetPlayerInterior(playerid); if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { DestroyVehicle(GetPlayerVehicleID(playerid)); GetPlayerPos(playerid, posX, posY, posZ); GetPlayerFacingAngle(playerid, angle); if(CurrentSpawnedVehicle[playerid] != -1) { DestroyVehicle(CurrentSpawnedVehicle[playerid]); } CurrentSpawnedVehicle[playerid] = CreateVehicle(modelid, posX, posY, posZ, angle, Colour1, Colour2, respawn_delay); LinkVehicleToInterior(CurrentSpawnedVehicle[playerid], interior); SetVehicleVirtualWorld(CurrentSpawnedVehicle[playerid], world); SetVehicleZAngle(CurrentSpawnedVehicle[playerid], angle); PutPlayerInVehicle(playerid, CurrentSpawnedVehicle[playerid], 0); SetPlayerInterior(playerid, interior); } if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { if(IsVehicleOccupied(CurrentSpawnedVehicle[playerid])) {} else DestroyVehicle(CurrentSpawnedVehicle[playerid]); GetPlayerPos(playerid, posX, posY, posZ); GetPlayerFacingAngle(playerid, angle); if(CurrentSpawnedVehicle[playerid] != -1) { DestroyVehicle(CurrentSpawnedVehicle[playerid]); } CurrentSpawnedVehicle[playerid] = CreateVehicle(modelid, posX, posY, posZ, angle, Colour1, Colour2, respawn_delay); LinkVehicleToInterior(CurrentSpawnedVehicle[playerid], interior); SetVehicleVirtualWorld(CurrentSpawnedVehicle[playerid], world); SetVehicleZAngle(CurrentSpawnedVehicle[playerid], angle); PutPlayerInVehicle(playerid, CurrentSpawnedVehicle[playerid], 0); SetPlayerInterior(playerid, interior); } return 1; }
(modelid, Float ![]() modelid The model for the vehicle. Float:X The X coordinate for the vehicle. Float:Y The Y coordinate for the vehicle. Float:Z The Z coordinate for the vehicle. Float:angle The facing angle for the vehicle. color1 The primary color ID. color2 The secondary color ID. respawn_delay The delay until the car is respawned without a driver in seconds. Using -1 will prevent the vehicle from respawning. |
Why are you posting the same damn problem over and over?
The answers are never gonna change. Check the respawn delay parameter, and figure it out yourself, no one is going to code anything for you, in case that's what you mean by "Please help seriously". |