SA-MP Forums Archive
[Help] AttachObjectToVehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] AttachObjectToVehicle (/showthread.php?tid=196379)



[Help] AttachObjectToVehicle - XePloiT - 05.12.2010

After i installed the RC3 the AttachObjectToVehicle doesn't work... :\


Re: [Help] AttachObjectToVehicle - papedo - 05.12.2010

You need to create the object first, before attempting to attach it to a vehicle.


Re: [Help] AttachObjectToVehicle - scottyishere - 05.12.2010

Quote:
Originally Posted by XePloiT
Посмотреть сообщение
After i installed the RC3 the AttachObjectToVehicle doesn't work... :\
And you expect us to guess what your problem is?

Be more explicit and post the section of the code where you used that function.


Re: [Help] AttachObjectToVehicle - XePloiT - 05.12.2010

Its worked perfectly on the RC1-2
pawn Код:
new TO[MAX_VEHICLES];
CMD:att(playerid,params[])
{
    new oID;
    DestroyObject(TO[GetPlayerVehicleID(playerid)]);
    if(sscanf(params,"i",oID)) return SendClientMessage(playerid,COLOR_WHITE,"Do: /Att [ {8a2be2}Object ID {ffffff}]");
    if(!isNumeric(params)) return SendClientMessage(playerid,COLOR_WHITE,"Do: /Att [ {8a2be2}Object ID {ffffff}] .");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"You Are Not In A {ff0000}Car");
    TO[GetPlayerVehicleID(playerid)] = CreateObject(oID, 0, 0, 0, 0, 0, 0);
    AttachObjectToVehicle(TO[GetPlayerVehicleID(playerid)],GetPlayerVehicleID(playerid),0,0,1,0,0,0);
    return 1;
}