Need Help Attach Object - 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: Need Help Attach Object (
/showthread.php?tid=319789)
Need Help Attach Object -
ServerScripter - 20.02.2012
Hi , i want to create an other vip cmds ,so i want /box then it set in the front of the Player a Box spo he can jump on it , i mean what is the Id of a good Box ? thanks .
Re: Need Help Attach Object -
JackT - 20.02.2012
Do you want a box that can be broken or stays strong?
Re: Need Help Attach Object -
ServerScripter - 20.02.2012
Stay Strong
Re: Need Help Attach Object -
redreaper666 - 20.02.2012
id 1685
a block that fits to your ask
^^
Re: Need Help Attach Object -
ServerScripter - 20.02.2012
so the function is :
AttachObjectToPlayer(playerid, ....;?
Re: Need Help Attach Object -
redreaper666 - 20.02.2012
maybe how i said i dont know anything about scripting but all about mapping stuff
Re: Need Help Attach Object -
iTorran - 20.02.2012
The player probably wont be able to jump on it if you attach it
Re: Need Help Attach Object -
ServerScripter - 20.02.2012
hmm.. i see so i don't need to attach it but
GetPlayer Position X, Y , Z+3 or something to spawn the object in the front of him
Re: Need Help Attach Object -
MP2 - 20.02.2012
Use this function:
pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if(GetPlayerVehicleID(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}