AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About banip command (https://forums.alliedmods.net/showthread.php?t=118242)

epic . 02-09-2010 02:25

About banip command
 
new szIp[32];
get_user_ip(id, szIp, charsmax(szIp), 1);
server_cmd("kick #%d;wait;wait;wait;addip %d ^"%s^";wait;wait;wait;writeip", get_user_userid(id), get_pcvar_num(g_iPcvar[CVAR_BANTIME]), szIp);

What is the "wait" means here? and why use "kick #%d" before addip ?


Thanks :o

DarkGod 02-09-2010 07:36

Re: About banip command
 
addip doesn't kick, that's why it has kick there...

One wait means one frame, it waits as many frames as the waits are before executing the next command.

epic . 02-09-2010 19:06

Re: About banip command
 
Quote:

Originally Posted by DarkGod (Post 1083543)
addip doesn't kick, that's why it has kick there...

One wait means one frame, it waits as many frames as the waits are before executing the next command.

Thank you :)

and, the last the question, if there are no "wait", what is the different ?



`

NiQu 02-09-2010 19:21

Re: About banip command
 
As if you make a say script in CS without wait's ur CS will crash, so my guess is:

The server might crash if u dont use waits.

epic . 02-09-2010 19:26

Re: About banip command
 
Thanks!
two nice people

Exolent[jNr] 02-09-2010 19:42

Re: About banip command
 
Quote:

Originally Posted by NiQu (Post 1084086)
As if you make a say script in CS without wait's ur CS will crash, so my guess is:

The server might crash if u dont use waits.

Wrong.

You use waits to add a time interval between commands.

Example, if you have a series of 5 say commands without waits, it will only print one because you cannot say 5 messages that fast.
So, you add waits in between so the game allows them to work.

If you don't have waits, it won't make your server crash.

Example:
Code:

alias settings1 "alias settings settings2; cl_minmodels 1; cl_righthand 1; net_graph 3; cl_showfps 0;"
alias settings2 "alias settings settings1; cl_minmodels 0; cl_righthand 0; net_graph 0; cl_showfps 1;"
alias settings "settings1"

bind "k" "settings"

// Press k to toggle settings


NiQu 02-09-2010 19:51

Re: About banip command
 
True exolent, but still if your making two commands without any waits, it will crash..
i made a say script..

Without about 70 waits it would crash my cs.

Exolent[jNr] 02-09-2010 19:54

Re: About banip command
 
Quote:

Originally Posted by NiQu (Post 1084101)
True exolent, but still if your making two commands without any waits, it will crash..
i made a say script..

Without about 70 waits it would crash my cs.

Show an example.

NiQu 02-09-2010 20:46

Re: About banip command
 
Code:

alias "w1" "wait;"
alias "w5" "w1;w1;w1;w1;w1;"
alias "w10" "w5;w5;"
alias "w15" "w10;w5;"
alias "w20" "w10;w10;"
alias "w25" "w15;w10;"
alias "w50" "w20;w20;w10;"
alias "w75" "w50;w25;"

alias "say1" "say Message 1"
alias "say2" "say Message 2"
alias "say3" "say Message 3"
alias "say4" "say Message 4"
alias "say5" "say Message 5"
//alias "say6" "say Add your message!"
//alias "say7" "say Add your message!"
//alias "say8" "say Add your message!"
//alias "say9" "say Add your message!"
//alias "say10" "say Add your message!"


alias "sayall" "say1; w75; say2; w75; say3; w75; say4; w75; say5; w75;"
//Add say6, 7, 8 ,9 and 10 if you are using them to.

bind "k" "sayall"

This one without wait crashes my cs.

Exolent[jNr] 02-09-2010 21:21

Re: About banip command
 
It shouldn't crash.


All times are GMT -4. The time now is 07:28.

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