Raised This Month: $ Target: $400
 0% 

[Resolved] Random client_cmd help please!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 03-12-2006 , 10:57   [Resolved] Random client_cmd help please!
Reply With Quote #1

Hi, I need to run a random client_cmd on a client, I have no clue how to randomize it though.

Here is what needs to be randomly chosen...
client_cmd(id,"+jump")
client_cmd(id,"+duck")
client_cmd(id,"+attack")

Can anyone help me please?
hlstriker is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-12-2006 , 11:11  
Reply With Quote #2

Code:
#define CMDS 3 new CMD[CMDS][] = {     "+jump",     "+duck",     "+attack" }
Code:
client_cmd(id, CMD[random(CMDS)])
VEN is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 03-12-2006 , 11:45  
Reply With Quote #3

Ok thanks alot, it works
hlstriker is offline
almaro
Junior Member
Join Date: Sep 2011
Location: Indonesia
Old 09-06-2012 , 03:19   Re: [Resolved] Random client_cmd help please!
Reply With Quote #4

how about random "wait" in client_cmd(wait;wait;wait;wait;snapshot) ? anyone?
almaro is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-06-2012 , 05:11   Re: [Resolved] Random client_cmd help please!
Reply With Quote #5

Code:
new i, ipos, cmd[128], random random = random_num(0,5) for (i = 0; i <= random, i++) {     ipos += formatex(cmd[ipos], charsmax(cmd) - ipos, "wait;") } formatex(cmd[ipos], charsmax(cmd) - ipos, "snapshot") client_cmd(id, cmd)
jimaway is offline
almaro
Junior Member
Join Date: Sep 2011
Location: Indonesia
Old 09-06-2012 , 23:34   Re: [Resolved] Random client_cmd help please!
Reply With Quote #6

Excellent work jim !
Now I can make every user take screenshot in random time (not simultaneous) by waiting n times / waiting x times. I would like to experiment using player id to make wait x times.

typo:
for (i = 0; i <= random, i++) { // must not use , but ;
for (i = 0; i <= random; i++) { // correct
almaro 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 20:23.


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