22.05.2015, 15:45
Hello
I have one problem!
When one of the players spawns vehicle someone others vehicle disaphears
How to fix it(I am using mSelection and this function!)
I have one problem!
When one of the players spawns vehicle someone others vehicle disaphears
How to fix it(I am using mSelection and this function!)
PHP Code:
function VehicleSpawner(playerid,model)
{
new Float:x,Float:y,Float:z,Float:a;
new componentid;
for (new i; i < 14; i++)
{
componentid = GetVehicleComponentInSlot(veh1[playerid], i);
if (componentid != 0)
RemoveVehicleComponent(veh1[playerid], componentid);
}
DestroyVehicle(veh1[playerid]);
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
veh1[playerid] = CreateVehicle(model,x+1,y+1,z,a,-1,-1,-1);
SetVehicleNumberPlate(veh1[playerid],""COL_WHITE"-"COL_RED"U"COL_GREEN"G"COL_BLUE"F"COL_WHITE"-");
LinkVehicleToInterior(veh1[playerid], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(veh1[playerid],GetPlayerVirtualWorld(playerid));
SetVehiclePos(veh1[playerid],x+1,y+1,z);
SetVehicleHealth(veh1[playerid], 1000.0);
PutPlayerInVehicle(playerid, veh1[playerid], 0);
return 1;
}