SA-MP Forums Archive
Bugged command. - 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: Bugged command. (/showthread.php?tid=440103)



Bugged command. - lQs - 28.05.2013

/solved.


Re: Bugged command. - RoboN1X - 28.05.2013

SetPlayerAttachedObject function is separated from Object functions, it won't delete the player's attached object with DestroyObject function.
Also it doesn't return the id, but the Package[playerid] will mostly returns 1 for successful of the SetPlayerAttachedObject function.
You can specify the ID, at the slot/index parameter.
In this case i will use index 0 (valid index is 0 to 9 for 0.3d), you can see the second param.
pawn Код:
SetPlayerAttachedObject(playerid, 0, 1220, 5, 0.031998, 0.327998, 0.165999, 2.899997,13.799991, 2.400001, 0.711000, 0.799998,0.751999, 0, 0);
To remove it, you can use RemovePlayerAttachedObject function.
Example: removing playerid's attached object at index 0 (as it was used for the garbage).
pawn Код:
RemovePlayerAttachedObject(playerid, 0);
Please note that, if you have an other code that uses the player attached object index 0 when it's already used, it will be replaced with new one. (Example: using setplayerattachedobject of clothes for index 0 when there is garbage being held already, the garbages is replaced with clothes).


Re: Bugged command. - lQs - 28.05.2013

Thanks.