AlliedModders

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

DahVid 08-24-2005 20:17

Print everything?
 
This is only suppose to print commands with alias and exec in them, it prints anything typed into the console.

Code:
public client_command(id) {     new command[50]     read_argv(0,command,49)         get_user_name(id,name,33)         if(containi(command,"exec")) {         client_print(0,print_chat,"[FuPlug]:%s performed exec %s.",name,command)     } }

Zenith77 08-24-2005 20:43

ok and the point of this post being...

DahVid 08-24-2005 20:58

and scrap the aliases, they are client-side now.

Sp4rt4n 08-24-2005 21:38

Quote:

Originally Posted by Zenith77
ok and the point of this post being...

he wants to know why that prints everything to the console, instead of just alias's and exec's

Zenith77 08-24-2005 21:42

lol because all commands have aliass prcatialy or execs..somewhere in there function..


istean of client command

just do like

register_clcmd("exec", bla bla)
and same ting for alias..

XxAvalanchexX 08-24-2005 23:30

Let's start off by saying anything equal to 0 is false, and anything else is equal to true. So, if(statement) will return true if statement is not equal to 0. The function containi returns -1 when the string is not found, since 0 would be the start of the string, and since -1 is not zero the statement goes through. Change your line to this:

Code:
if(containi(variable,"string") != -1){

> -1 would work also.


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

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