AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   why is dont work? (https://forums.alliedmods.net/showthread.php?t=171082)

oei 11-01-2011 09:27

why is dont work?
 
PHP Code:

new const Cmd[][] = { "say /shop""say shop""radio1" 

PHP Code:

//in plugin_init
register_clcmd(Cmd[1], "shop"

thx.

Evaldas.Grigas 11-01-2011 09:29

Re: why is dont work?
 
Quote:

Originally Posted by oei (Post 1587835)
PHP Code:

new const Cmd[][] = { "say /shop""say shop""radio1" 

PHP Code:

//in plugin_init
register_clcmd(Cmd[1], "shop"

thx.

You forgot:
PHP Code:

for(new 0sizeof Cmdi++)
register_clcmd(Cmd[1], "shop"


Korxu 11-01-2011 09:50

Re: why is dont work?
 
PHP Code:

new gsz_Cmds [ ] [ ] = { "say /shop""say_team /shop""say shop""say_team shop" }

// ...
public plugin_init ( )
{
     static 
i
     
for ( 0sizeof gsz_Cmds ); ++ )
     {
          
register_clcmd gsz_Cmds ], "shop" )
     }



oei 11-01-2011 09:57

Re: why is dont work?
 
Quote:

Originally Posted by Korxu (Post 1587854)
PHP Code:

new gsz_Cmds [ ] [ ] = { "say /shop""say_team /shop""say shop""say_team shop" }
 
// ...
public plugin_init ( )
{
     static 
i
     
for ( 0sizeof gsz_Cmds ); ++ )
     {
          
register_clcmd gsz_Cmds ], "shop" )
     }



i wont Not many lines
like this:

Quote:

Originally Posted by Evaldas.Grigas (Post 1587837)
You forgot:
PHP Code:

for(new 0sizeof Cmdi++)
register_clcmd(Cmd[1], "shop"


Dont work..

Korxu 11-01-2011 10:20

Re: why is dont work?
 
Try my code... but it is the same.
PHP Code:

for ( new 0sizeof Cmd ); ++ )
     
register_clcmd Cmd ], "shop" 


Napoleon_be 11-01-2011 10:38

Re: why is dont work?
 
PHP Code:

new const Cmd[][] = { "say /shop""say shop""radio1" 

-->
PHP Code:

new const Cmd[3][] = { 
"say /shop"
"say shop"
"radio1" 


try this..

oei 11-01-2011 10:39

Re: why is dont work?
 
Quote:

Originally Posted by Korxu (Post 1587876)
Try my code... but it is the same.
PHP Code:

for ( new 0sizeof Cmd ); ++ )
     
register_clcmd Cmd ], "shop" 


thx work

Erox902 11-01-2011 10:47

Re: why is dont work?
 
Quote:

Originally Posted by Napoleon_be (Post 1587886)
PHP Code:

new const Cmd[][] = { "say /shop""say shop""radio1" 

-->
PHP Code:

new const Cmd[3][] = { 
"say /shop"
"say shop"
"radio1" 


try this..

absolutely no difference exept you hardcoded how many commands there were


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

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