SA-MP Forums Archive
[Help]Attaching an object to a player. - 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: [Help]Attaching an object to a player. (/showthread.php?tid=288312)



[Help]Attaching an object to a player. - moadi - 07.10.2011

Hey ,

I've been trying to script a humanbomb CMD .

Once someone/you excute the CMD an object(bomb) appears on the player's chest for a certain ammount of time then it disappears .

This is what i got so far but i'm having a problem with AttachObjectToPlayer , how can i get it to work ?

pawn Code:
new Float:x,Float:y,Float:z,object;
CMD:humanbomb(playerid, o[]);
{
GetPlayerPos(playerid, x, y, z);
object = AttachObjectToPlayer(? ? ???? ? ??  ?? );

//What coords should i use ? and do i have to CreateObject ?

SetTimer("humanbomb1", 3000, 0);
return 1;
}
forward humanbomb1();
public humanbomb1()
{
CreateExplosion(x, y, z, 7, 100);
DestroyObject(object);
return 1;
}



Re: [Help]Attaching an object to a player. - CyNiC - 07.10.2011

Use SetPlayerAtachedObject, is totally synced.

With this FS you can get the coords and see the function syntax:

https://sampforum.blast.hk/showthread.php?tid=182317