Random numbers ?
How would you set up a Pseudo Random Number Generator in so...lets say when you spawn it would run through a list of random numbers...pick one then if that number is lets say < 10 it would give a player faster speed or lower gravity or a specified weapon. if someone can help me with the RNG i think i can figure out the rest of the code.
|
Re: Random numbers ?
Roll the dice?
|
Re: Random numbers ?
uhh..
random_float - Generates random floating point number from a to b Float: random_float ( Float:a,Float:b ) random_num - Generates random integer from a to b. random_num ( a,b ) |
Re: Random numbers ?
ok..thank you, is there a way to call that number back like store it or can you just do this:
Code:
|
Re: Random numbers ?
Code:
new rnd |
Re: Random numbers ?
ok...thank you +karma 4 u
|
Re: Random numbers ?
One more thing...im running into a small problem
Code:
|
Re: Random numbers ?
cs_get_user_bpammo
cs_get_weapon_ammo cs_set_user_bpammo cs_set_weapon_ammo look them up in http://www.amxmodx.org/funcwiki.php |
Re: Random numbers ?
ok i got that working now...but for some reason i cannot set the ammo defined for the weapon...
I.E. Code:
FOR SOME REASON...it give you awp...if number is in range...but gives it to you with 10 bullets and none in the pack. |
Re: Random numbers ?
cs_set_user_bpammo(id, CSW_AWP, 30)
|
| All times are GMT -4. The time now is 06:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.