Raised This Month: $ Target: $400
 0% 

clcmd waittime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-14-2011 , 18:31   clcmd waittime
Reply With Quote #1

heyo I use a function that is called when someone say /best.
The function show a message with print chat

Anyway it often got abused to spam the chat.

Im not a scripter so if someone could do this would be very nice.

something like this:

After someone write /best everyone have to wait at least 10 sec to use it again.

Hope you understand what I mean

Last edited by plowed; 07-14-2011 at 18:59.
plowed is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-14-2011 , 18:59   Re: clcmd waittime
Reply With Quote #2

Does this plugin already exist? If yes, post a link or the code (if it's not on the forums already).
__________________

Last edited by fysiks; 07-14-2011 at 19:03.
fysiks is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-14-2011 , 19:41   Re: clcmd waittime
Reply With Quote #3

Its just a simple textmessage which is part of a full plugin.

PHP Code:
public plugin_init()
{
register_plugin("ProKreedz","2.0z","p4ddY & Diggz & nucLeaR")
register_clcmd("say /best""best_climber")
}

public 
best_climber()
{
if (!
leader)
    {
        
ColorChat(0GREEN,"^x04[^x03 247cs ^x04]^x01 There is no map best time yet.");
    }
else
    {
    new 
name[32]
    
get_user_name(leadername31)
    
ColorChat(0GREEN,"^x04[^x03 247cs ^x04]^x04 %s^x01 is the current map best with^x04 %s" ,name,format_kreedz_time(best_time[leader]));
    }
return 
PLUGIN_HANDLED

plowed is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-14-2011 , 23:24   Re: clcmd waittime
Reply With Quote #4

Here ya go:

PHP Code:
public best_climber()
{
    static 
iTimeCmdIsAllowed
    
if( get_systime() > iTimeCmdIsAllowed )
    {
        if (!
leader)
        {
            
ColorChat(0GREEN,"^x04[^x03 247cs ^x04]^x01 There is no map best time yet.");
        }
        else
        {
            new 
name[32]
            
get_user_name(leadername31)
            
ColorChat(0GREEN,"^x04[^x03 247cs ^x04]^x04 %s^x01 is the current map best with^x04 %s" ,name,format_kreedz_time(best_time[leader]));
        }
        
iTimeCmdIsAllowed get_systime() + 10
    
}
    else
    {
        
// 10 seconds has not passed since command was last used.
    
}
    return 
PLUGIN_HANDLED

__________________
fysiks is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 07-15-2011 , 02:19   Re: clcmd waittime
Reply With Quote #5

fysiks your are great man .. i am learning from each every post of yours ..i don't even skip a single post of yours and exolent's ... both of you rock
gamer99 is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-15-2011 , 05:32   Re: clcmd waittime
Reply With Quote #6

nice work fysik, thanks ^^
plowed is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:09.


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