Raised This Month: $ Target: $400
 0% 

Problem with random_num


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sorinel
Junior Member
Join Date: Mar 2018
Location: Romania
Old 05-28-2018 , 07:51   Problem with random_num
Reply With Quote #1

--

Last edited by Sorinel; 09-20-2018 at 18:52.
Sorinel is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-28-2018 , 08:46   Re: Problem with random_num
Reply With Quote #2

This won't work all time, since you're setting "100" as max value of random num. The chance to reach a value smaller than the cvar in this case, is 29%. Also, change this:

Code:
public fwHamPlayerSpawnPost(id) {          if(!is_user_connected(id))                 return HAM_IGNORED          StartEvent(id)          return HAM_OVERRIDE }



Code:
public fwHamPlayerSpawnPost(id) {          if(!is_user_alive(id))                 return          StartEvent(id) }

NOTE: return values are ignored in post forwards.
__________________









Last edited by CrazY.; 05-28-2018 at 08:50.
CrazY. is offline
Sorinel
Junior Member
Join Date: Mar 2018
Location: Romania
Old 05-28-2018 , 09:06   Re: Problem with random_num
Reply With Quote #3

you have another solution for me?
Sorinel is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-28-2018 , 09:08   Re: Problem with random_num
Reply With Quote #4

Before this, tell me, this will only give ak47 or also other weapons?
__________________








CrazY. is offline
Sorinel
Junior Member
Join Date: Mar 2018
Location: Romania
Old 05-28-2018 , 09:18   Re: Problem with random_num
Reply With Quote #5

now ak, but i want watergun after resolve it
Sorinel is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-28-2018 , 09:57   Re: Problem with random_num
Reply With Quote #6

So... just increase cvar value.
__________________








CrazY. is offline
Sorinel
Junior Member
Join Date: Mar 2018
Location: Romania
Old 05-28-2018 , 10:57   Re: Problem with random_num
Reply With Quote #7

i want to give ak for all players like a zp mode with chance, yes i know if grow value give ak for all
Sorinel is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-28-2018 , 15:13   Re: Problem with random_num
Reply With Quote #8

To get the correct probabilities, iRand should be random(100).
__________________
fysiks 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 15:00.


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