AlliedModders

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

Dark Style 10-30-2011 14:57

Capturing say
 
How can I capture in the console a word with 2 spaces before ?
For exemple:
(1 space)
Code:

say /a
(2 spaces)
Code:

say  /a

alan_el_more 10-30-2011 15:27

Re: Capturing say
 
Use trim():
http://www.amxmodx.org/funcwiki.php?go=func&id=570

Dark Style 10-30-2011 15:28

Re: Capturing say
 
not solved my problem

I want get it on register_clcmd or register_concmd

Bugsy 10-30-2011 15:32

Re: Capturing say
 
PHP Code:

register_clcmd"say  /a" "SaidCmd" 

Or hook say then check arg

PHP Code:

register_clcmd"say" "HookSay" )

public 
HookSay( if )
{
   
//check arg here



Dark Style 10-30-2011 15:35

Re: Capturing say
 
I want the first, but don't works.

PHP Code:

formatex(szformatcharsmax(szformat), "say  %s"buffer);
            
register_clcmd(szformat"handle"); 


Bugsy 10-30-2011 15:43

Re: Capturing say
 
Why are you formatting to register the client cmd, just register it exactly as you want it.

Dark Style 10-30-2011 15:44

Re: Capturing say
 
because I read the command from a file.

Bugsy 10-30-2011 15:48

Re: Capturing say
 
server or client print the value to be sure its being read properly from file.

server_print ( "[%s]" , buffer )


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

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