AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Use command one time per day. (https://forums.alliedmods.net/showthread.php?t=195182)

danielo_o 09-04-2012 11:17

Use command one time per day.
 
Please help me :d

Torge 09-04-2012 11:22

Re: Use command one time per day.
 
I think that work with command limiter, search it.

danielo_o 09-04-2012 14:33

Re: Use command one time per day.
 
I didn't find it.

YamiKaitou 09-04-2012 14:38

Re: Use command one time per day.
 
Search again, it is there.

OnePL 09-05-2012 07:50

Re: Use command one time per day.
 
Maybe something like this?

PHP Code:

#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "OnePL"

new last_used

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /something""block_use")
}

public 
block_use(id) {
    if(
get_systime() - last_used 86400 /*time in seconds*/) {
        
client_print(idprint_chat"This command can use once per day!")
        return 
PLUGIN_HANDLED
    
}

    
// code here

    
last_used get_systime()
    return 
PLUGIN_HANDLED



daniel46 09-05-2012 08:02

Re: Use command one time per day.
 
also can be used like this

PHP Code:

new bool:one_time

public plugin_init() register_event("HLTV""NewRound""a""1=0""2=0")  

public 
NewRound() one_time false

public code()
{
    
one_time true
    
    
if(one_timeclient_print(idprint_chat"This Coammnd Can Used 1 Time A Round"
    
    
else if(!one_time)
    {
    
// Your Code
    
}



Bos93 09-05-2012 08:04

Re: Use command one time per day.
 
http://forums.alliedmods.net/showthread.php?t=176058


All times are GMT -4. The time now is 08:22.

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