AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how many times cmd used (https://forums.alliedmods.net/showthread.php?t=89509)

One 04-07-2009 10:56

how many times cmd used
 
hihi :mrgreen:

how can i know howmany times a user used a cmd?

Dores 04-07-2009 11:16

Re: how many times cmd used
 
I think danielkza's Command Limiter would help you out.

SnoW 04-07-2009 14:32

Re: how many times cmd used
 
PHP Code:

new gCommandUses33 ];
public 
plugin_init()
    
register_clcmd"command""command_function" );
public 
command_functionid )
{
    
gCommandUsesid ]++;
    
//...



Dores 04-07-2009 14:49

Re: how many times cmd used
 
PHP Code:

new CommandsCount[33];

public 
client_command(id)
{
    
CommandsCount[id]++;



One 04-07-2009 15:07

Re: how many times cmd used
 
PHP Code:

new gCommandUses33 ];
public 
plugin_init()
    
register_clcmd"command""command_function" );
public 
command_functionid )
{
    
gCommandUses[id]++;
    
//...


lol ok example ill use this :

PHP Code:

new gCommandUses33 ];
public 
plugin_init()
    
register_clcmdsay /hi", "command_function" );
public command_function( id )
{
    gCommandUses[id]++;
    //...


now a if:

if(gCommandUses[id] == 5 ) <<< is this right?

Dores 04-07-2009 15:30

Re: how many times cmd used
 
Yes.

One 04-07-2009 15:43

Re: how many times cmd used
 
T & Y :mrgreen:

edit : hmmm client_print(id, "u have used %d times this cmd", gCommandUses[id] )

hmmm this sounds a littlleeee.... crazy or not?i didnt test it, but i cant imagin this.. hmmm

Dores 04-07-2009 16:45

Re: how many times cmd used
 
It's fine.

One 04-07-2009 17:27

Re: how many times cmd used
 
oki :mrgreen:


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

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