Random position around 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: Random position around player (
/showthread.php?tid=630861)
Random position around player -
GoldenLion - 19.03.2017
Hi, how is it possible to get random positions around player? I want the player to drop his weapons around him when he dies and I don't want the weapons to lay on each other.
EDIT: I'm stupid, I just found this:
https://sampforum.blast.hk/showthread.php?tid=269857
Re: Random position around player -
iKarim - 19.03.2017
PHP код:
new
Float: x,
Float: y,
Float: z
;
GetPlayerPos( playerid, x, y, z );
CreatePickup( .., ..., ( x + ( random( 6 ) - 3 ) ), ( y + ( random( 6 ) - 3 ) ), z, ... );
I usually do it like that, it may sound complicated (it is not), but that's the best method I've tried so far.
Re: Random position around player -
GoldenLion - 19.03.2017
Quote:
Originally Posted by PawnHunter
PHP код:
new
Float: x,
Float: y,
Float: z
;
GetPlayerPos( playerid, x, y, z );
CreatePickup( .., ..., ( x + ( random( 6 ) - 3 ) ), ( y + ( random( 6 ) - 3 ) ), z, ... );
I usually do it like that, it may sound complicated (it is not), but that's the best method I've tried so far.
|
Thanks.