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



SetPlayerAttachedObject - Millionaire - 23.08.2011

Hello!
how to remove SetPlayerAttachedObject ? if i use a cmd then the player will get some objects in their hands but to remove it ,players should do /kill.How to make a remove cmd?


Re: SetPlayerAttachedObject - Jafet_Macario - 23.08.2011

pawn Code:
if(IsPlayerAttachedObjectSlotUsed(playerid,index)) RemovePlayerAttachedObject(playerid,index);
playerid - ID of the player you want to remove the object from.
index - index of the object.


Re: SetPlayerAttachedObject - Millionaire - 23.08.2011

pawn Code:
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM_Lux.pwn(27088) : error 017: undefined symbol "index"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM_Lux.pwn(27088) : error 017: undefined symbol "index"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
But it shows these errors


Re: SetPlayerAttachedObject - Millionaire - 23.08.2011

And the object is not removing completely


Re: SetPlayerAttachedObject - Jafet_Macario - 23.08.2011

You must replace
Code:
index
with the object's index, for example you got:
pawn Code:
SetPlayerAttachedObject(playerid, 2, ...blabla);
so the INDEX is 2, then you must go:
pawn Code:
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);



Re: SetPlayerAttachedObject - Millionaire - 23.08.2011

i got total 6 cmds and different objects, so how can i do that?