AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with random_num (https://forums.alliedmods.net/showthread.php?t=307862)

Sorinel 05-28-2018 07:51

Problem with random_num
 
--

CrazY. 05-28-2018 08:46

Re: Problem with random_num
 
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 }

:arrow:

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

NOTE: return values are ignored in post forwards.

Sorinel 05-28-2018 09:06

Re: Problem with random_num
 
you have another solution for me?

CrazY. 05-28-2018 09:08

Re: Problem with random_num
 
Before this, tell me, this will only give ak47 or also other weapons?

Sorinel 05-28-2018 09:18

Re: Problem with random_num
 
now ak, but i want watergun after resolve it

CrazY. 05-28-2018 09:57

Re: Problem with random_num
 
So... just increase cvar value.

Sorinel 05-28-2018 10:57

Re: Problem with random_num
 
i want to give ak for all players like a zp mode with chance, yes i know if grow value give ak for all

fysiks 05-28-2018 15:13

Re: Problem with random_num
 
To get the correct probabilities, iRand should be random(100).


All times are GMT -4. The time now is 04:34.

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