Raised This Month: $ Target: $400
 0% 

execute a command every x rounds!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joelverghese
Member
Join Date: Oct 2011
Old 05-20-2014 , 08:25   execute a command every x rounds!
Reply With Quote #1

Hello AM,
I need to know a way by which i can execute a command every x round i wish.
For example i want to execute amx_slap every x round to the CT team how could i do that !
joelverghese is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 05-20-2014 , 09:01   Re: execute a command every x rounds!
Reply With Quote #2

PHP Code:
#include <amxmodx>

new szRoundpCvarmaxpl;

public 
plugin_init() {
    
register_plugin("Slap every X round""1.0""OnePL");

    
pCvar register_cvar("amx_slap_round""2");

    
register_logevent("RoundEnd"2"1=Round_End");
    
register_logevent("RoundStart"2"1=Round_Start");
    
register_logevent("RestartContin"2"1=Game_Commencing");

    
register_event("TextMsg""RestartGame""a""2&#Game_w");

    
maxpl get_maxplayers();
}

public 
RoundEnd() szRound += 1;
public 
RestartGame() szRound 0;
public 
RestartContin() szRound = -1;

public 
RoundStart() {
    if(
szRound%== get_pcvar_num(pCvar)) {
        for(new 
1<= maxpli++) {
            if(!
is_user_alive(i)) continue;

            
server_cmd("amx_slap #%i 5"get_user_userid(i));
            
//5 - power
        
}
    }

cvar amx_slap_round

plugin splits for 7 rounds (such as days of the week)
if amx_slap_round is equates 2 to execute a command on the second day of the week (Tuesday)
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
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 09:39.


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