SA-MP Forums Archive
EditObject in a vehicle? - 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: EditObject in a vehicle? (/showthread.php?tid=383007)



EditObject in a vehicle? - 2KY - 06.10.2012

EDIT: I've done this -

pawn Код:
CMD:test( playerid, params[] )
{
    new id;
   
        if( sscanf( params, "i", id ) )
            return false;
           
    new Float:p[3];
   
    GetVehiclePos( id, p[0], p[1], p[2]);
   
    vehAttachedObject [ id ] = CreateObject( 18648, p[0],p[1],p[2], 0.0, 0.0, 0.0, 0 );
    //AttachObjectToVehicle( vehAttachedObject [ GetPlayerVehicleID ( playerid ) ], GetPlayerVehicleID( playerid ), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
       
    EditObject( playerid, vehAttachedObject [ id ] );
    return true;
}
and it works nice, problem is, I need it to save and then attach it to a vehicle. Would the object coordinates still be right, or would they be world coordinates? If not, how do I convert them?