Weapon offsets? - 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: Weapon offsets? (
/showthread.php?tid=507625)
Weapon offsets? -
kristo - 18.04.2014
Where could I find offsets for attaching weapons to a player so they'd look just like "real"? Which dat file should I look at?
Re : Weapon offsets? -
S4t3K - 18.04.2014
Try this small code in a filterscript.
PHP код:
// When you attach the Object
new object[MAX_PLAYERS];
object[playerid] = SetPlayerAttachedObject(params);
EditPlayerObject(playerid, object[playerid]);
public OnPlayerEditAttachedObject(playerid, response)
{
if(response)
{
new Float:pos[3];
GetObjectPos(object[playerid], pos[0], pos[1], pos[2]);
printf("Object offset is x = %f | y = %f | z = %f", pos[0], pos[1], pos[2]);
}
}
But you have to be good in mathematics for the next part (Getting player pos then do operations to get the offsets), thing I'm not.
Re: Weapon offsets? -
Marricio - 18.04.2014
You can attach them in the hand bone with 0 on all offsets, I am pretty sure it will look good.