SA-MP Forums Archive
How to remove object from veh ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to remove object from veh ? (/showthread.php?tid=644753)



How to remove object from veh ? - Maky184 - 13.11.2017

How to remove object from vehicle ?


Re: How to remove object from veh ? - TomRedlake - 13.11.2017

What do you actually mean by that? Do you want to remove for example barrels which can spawn on Saddler?


If you do want that its not possible... only if you attach other object to hide that


Re: How to remove object from veh ? - Pool - 13.11.2017

I believe that the function to perform this action is the same as to destroy any object.
See if it works as follows, using sscanf2 ...:
PHP код:
new obj[MAX_PLAYERS];
CMD:var(playeridparams[]) {
    new 
idobjGetPlayerVehicleID(playerid) ,Float:pos[3], Float:r[3];
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    if(
sscanf(params"i"idobj)) return SendClientMessage(playerid, -1"Use - '/var' [id object]");
    
obj[playerid] = CreateObject(idobjpos[0], pos[1], pos[2], r[0], r[1], r[2], 0.0);
    
AttachObjectToVehicle(idobjvpos[0], pos[1], pos[2], r[0], r[1], r[2]);
    return 
true;
}
CMD:dvar(playerid)
{
    
DestroyObject(obj[playerid]);
    return 
true;