All Vehicles Spawner Menu
#1

Hi, i am making an object editor, i need ur help, i need a special filterscript for spawn vehicles, i can spawn vehicles and i save it in variable, but how i can obtain the ID for remove vehicles spawned or for remove all vehicles spawned??.. thanks
Reply
#2

the variable you save it in is the ID of the vehicle.
Reply
#3

ok, my code:

Quote:

enum VEHICLEDATA(){
Text3D:v3dtext,
id
}

new Veh[150][VEHICLEDATA];

stock CreateVehFromList(listitem, playerid)
{
new Float: x, Float: y, Float:z;
GetPlayerPos(playerid, x, y, z);

new vid = CreateVehicle(listitem+400,x+1.2,y+1.2,z,0,-1,-1,600000);

LinkVehicleToInterior(vid,GetPlayerInterior(player id));

new text[64];
format(text,sizeof(text),"[%d] %s spawned !", listitem+400,VehicleName[listitem]);
SendClientMessage(playerid, COLOR_MAGENTA, text);

Veh[vid][id] = vid;
new str[256];
format(str, sizeof(str), "[VEHICLE] \nModel: %i \nVehicleID: %i", GetVehicleModel(vid),Veh[vid][id]);
Veh[vid][v3dtext] = Create3DTextLabel(str,0xFF0000FF,0.0,0.0,0.0,50.0,-1,1);
Attach3DTextLabelToVehicle(Veh[vid][v3dtext],vid,0.0,0.0,0.5);
}

can u say me if is it good?


but for remove all cars created or remove by id no work:

Quote:

stock RemoveVeh(inputtext[])
{
new playerid;

if (strval(inputtext) != 0 )
{
DestroyVehicle(strval(inputtext));
}
else
{
for(new i = 0; i < 150; i++)
{
DestroyVehicle(i);
}
}
}

in InputText you type 0 if u want delete all or an id...
thanks..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)