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



SetPlayerAttachedObject Help - alishvasis - 27.01.2014

How To Use Random SetPlayerAttachedObject ?

Pls Help Me TnX


Re: SetPlayerAttachedObject Help - jiwan - 27.01.2014

....
https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject


Re: SetPlayerAttachedObject Help - Lidor124 - 27.01.2014

I will give you the idea:

on rand = random( 4 ), (change the 4 to number object of random you wish)

on the cases instead of objectid set the number of your object for the random.

On your top of your script
Quote:

new
rand = random( 4 ),
myobject
;
switch( rand )
{
case 0: objectid;
case 1: objectid:
case 2: objectid;
case 3: objectid;
}

then on your code:

SetPlayerAttachedObject(playerid, index, myobject, bla bla bla bla..); // myobject is your random objects number

Hope it helps D: