AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How can i make a function... (https://forums.alliedmods.net/showthread.php?t=141326)

Zezima14 10-22-2010 14:43

How can i make a function...
 
How can i make that??

example i want register a clcmd and can type in say "/hi" and later a name:
result:

say /hi NAME

other example

say /hi Zezima14


Thanks, and excuse my little english.

fysiks 10-22-2010 18:30

Re: How can i make a function...
 
You have to register only "say" and then parse the information manually.

Zezima14 10-22-2010 19:37

Re: How can i make a function...
 
i tried with this:


PHP Code:


register_clcmd
"say /hi""CmdPlayers" )

[...]

public 
CmdPlayersid )
{
     static 
szArg32 ];
     
read_argv1szArg31 )

     new 
Target cmd_targetid szArg )

     if( !
Target )
          return 
PLUGIN_HANDLED;

     
client_printTarget print_chat"Hi %s"szArg] )
     return 
PLUGIN_HANDLED;


But doesn't work...

fysiks 10-22-2010 21:26

Re: How can i make a function...
 
Quote:

Originally Posted by fysiks (Post 1331941)
You have to register only "say" and then parse the information manually.

1. read_args()
2. remove quotes
3. remove /hi
4. Use what is left over.


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

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