Raised This Month: $ Target: $400
 0% 

Solved Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Th3822
Member
Join Date: Jan 2013
Location: Venezuela
Old 09-14-2019 , 14:40   Re: Player "not in-game" at Ham_Spawn (post) on lastest 1.9 but working on 1.8.2
Reply With Quote #1

Quote:
Originally Posted by AmXDusT View Post
Just for curiosity
PHP Code:
// random_mod(max): A small function to give a random number from 0 to max-1. Useful for get random values from arrays
#define random_mod(%1) (random_num(0, (100 * (%1)) - 1) % (%1)) 
Is there any use of getting random that way instead of simply "random_num( 0, (%1) - 1 )"?
This one i can reply right away (i will answer the other one, when i get home from work):

I always disliked how random_num gives results that looks "not so random" when using small numbers, so i make a big random number and apply modulo on it to get a value from 0-(%1 - 1)

Of course, this is just personal opinion... But i have noticed the differences while using it and i'm happy with it.
Th3822 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode