A simple question with spawning cars.
#1

Alright, I have a question..

Say, I made an admin vehicle spawn. How could I make it despawn when it blows up, i.e destroy? But only for that vehicle and not like player owned ones.

pawn Код:
CMD:spawncar(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
   
    if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
    new vmodel, colour1, colour2;
    if(sscanf(params, "ddd", vmodel, colour1, colour2)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /spawncar [model] [colour 1] [colour 2]");
   
    new Float:scx,Float:scy, Float:scz, Float:sca;
    GetPlayerPos(playerid, scx, scy, scz);
    GetPlayerFacingAngle(playerid, sca);
   
    new vehicleid = CreateVehicle(vmodel, scx, scy+5, scz, sca, colour1, colour2, -1);
    new plate[50];
    format(plate, sizeof(plate), "BCRP%d", vehicleid);
    SetVehicleNumberPlate(vehicleid, plate);
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    EngineStartStatus[vehicleid] = 0;
    return 1;
}
Reply


Messages In This Thread
A simple question with spawning cars. - by Dokins - 20.11.2012, 22:38
Re: A simple question with spawning cars. - by ThePhenix - 20.11.2012, 22:52
Re: A simple question with spawning cars. - by Dokins - 20.11.2012, 23:03
Re: A simple question with spawning cars. - by Dubya - 21.11.2012, 00:17
Re: A simple question with spawning cars. - by Scenario - 21.11.2012, 02:26
Re: A simple question with spawning cars. - by EliteApple - 21.11.2012, 03:00
Re: A simple question with spawning cars. - by Dokins - 21.11.2012, 16:04

Forum Jump:


Users browsing this thread: 1 Guest(s)