Attach Help - 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: Attach Help (
/showthread.php?tid=396361)
Attach Help -
teomakedonija - 30.11.2012
pawn Код:
if(strcmp(cmd, "/stavidrva", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x, Float:y, Float:z;
AttachObjectToVehicle(drvo,kamion,1062.80004883,-338.20001221,74.80000305,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}Drvata se uspesno natovareni vo kamionot");
}
}
pawn Код:
kamion = AddStaticVehicle(578,1062.69995117,-337.79998779,74.69999695,0.00000000,245,245); //DFT-30
drvo = CreateObject(1463,1066.30004883,-341.70001221,73.30000305,0.00000000,0.00000000,0.00000000);
And now when i type /stavidrva the drvo(tree) dont in saved position on the car..When i type /stavidrva object drvo(tree) disappears please help me !
Re: Attach Help -
teomakedonija - 30.11.2012
Bump !
Re: Attach Help -
Sam5513 - 30.11.2012
Код:
if(strcmp(cmd, "/stavidrva", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) // if he isnt in a vehicle
{
return SendClientMessage(playerid,COLOR_RED,"You have to be in a vehicle to use this.");
}
new vid;
vid=GetPlayerVehicleID(playerid);
AttachObectToVehicle(drvo,vid,1062.80004883,-338.20001221,74.80000305,0,0,0);
SendClientMessage(playerid,COLOR_GREEN,"Object attached.");
return 1;
}
untested
Re: Attach Help -
teomakedonija - 01.12.2012
again disappears :@
Re: Attach Help -
[MM]RoXoR[FS] - 01.12.2012
When attaching object x,y,z are not location of vehicle but the offset.
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
In your case they are toooo big. Rectify it.