AlliedModders

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

zi443r 07-08-2013 01:44

random_num()
 
i have this part of code:
PHP Code:

if (is_user_connected(id)) {....
client_cmd(id"connect %s:%d"g_IP[random_num(0sizeof(g_IP)-1)], g_portcvar)
log_message("[Redirect] Sent %s <%s> to new ip:%s"info1info2g_IP[random_num(0sizeof(g_IP)-1)])
...} 

both g_IP[random_num(0, sizeof(g_IP)-1)] will have the same value?
or i need to store it before?

Blizzard_87 07-08-2013 02:24

Re: random_num()
 
redirecting a client by forcing client_cmd doesnt work anymore with latest Update.

fysiks 07-08-2013 02:35

Re: random_num()
 
While this code doesn't work anymore, the answer to the actual question is that you have to store the value because the random_num() function gets a random number.

zi443r 07-08-2013 02:35

Re: random_num()
 
thanx,i'll update to the latest version.

zi443r 07-08-2013 13:16

Re: random_num()
 
it's working very well on latest update:

PHP Code:

Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build17:46:18 Apr 25 2013 (6027


YamiKaitou 07-08-2013 15:54

Re: random_num()
 
Sorry, we will not help people who try to get around Valve's blocks

tonykaram1993 07-08-2013 18:34

Re: random_num()
 
I have question regarding this matter.
If cl_filterstuffcmd is set to 0, will it still block slow hacking? Or must it be set to 1?

YamiKaitou 07-08-2013 19:06

Re: random_num()
 
Last I checked, still block it. I do not believe the implementation of cl_filterstuffcmd is done yet

fysiks 07-08-2013 19:09

Re: random_num()
 
Quote:

Originally Posted by YamiKaitou (Post 1986624)
Last I checked, still block it. I do not believe the implementation of cl_filterstuffcmd is done yet

I think there were some things permanently blocked regardless of the value of cl_filterstuffcmd, binds being one of them. I believe that connect is also one of them but I can't remember for sure.

YamiKaitou 07-08-2013 19:11

Re: Re: random_num()
 
Quote:

Originally Posted by fysiks (Post 1986626)
I think there were some things permanently blocked regardless of the value of cl_filterstuffcmd, binds being one of them. I believe that connect is also one of them but I can't remember for sure.

That could be it too. I know in a future update they are going to default it to 1 and setting it to 0 will disable the check.


All times are GMT -4. The time now is 06:30.

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