19.11.2009, 11:46
Hey..
i got a carspawning filterscript, but when i spawn a vehicle, leave it, and spawn another one, the old vehicle stays.
any ideas to only have one vehicle spawned at time?
the code looks like this..
If someone got a solution for this, please copy the code and add your sulution and post it. thanks.
i got a carspawning filterscript, but when i spawn a vehicle, leave it, and spawn another one, the old vehicle stays.
any ideas to only have one vehicle spawned at time?
the code looks like this..
Код:
stock aCreateThing(playerid, thingid, orderid)
{
new pVeh[MAX_PLAYERS] = -1;
if(pVeh[playerid] != -1)
DestroyVehicle(pVeh[playerid]);
new Float:X, Float:Y, Float:Z, Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
if(thingid != 597)
{
Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, random(126), random(126), 30);
}
else
{
Vehicle[orderid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, 0, 1, 30);
}
PutPlayerInVehicle(playerid, Vehicle[orderid], 0);
TogglePlayerControllable(playerid, true);
return 1;
}


lol i am such a noob..
