Raised This Month: $ Target: $400
 0% 

NELAN 2004 LAN Tournament, needs your scripting help!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellraser
Member
Join Date: Jul 2004
Old 09-10-2004 , 17:44  
Reply With Quote #1

Very good code, how could i kinda make a command to restart the match and would 'unready' everyone so everybody would have to type "ready" once again?
hellraser is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-10-2004 , 19:48  
Reply With Quote #2

It looks like it already does that.
__________________
twistedeuphoria is offline
hellraser
Member
Join Date: Jul 2004
Old 09-11-2004 , 03:24  
Reply With Quote #3

No cause,if u like type a retry in the moddle of the match the server will always consider you as " ready", it doesn't clear up the buffer...
hellraser is offline
hellraser
Member
Join Date: Jul 2004
Old 09-12-2004 , 13:43  
Reply With Quote #4

nobody knows how to make a 'unready' cmd? Its just to do a counter -1 but i dunno how.....:'(
hellraser is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 09-12-2004 , 15:17  
Reply With Quote #5

Code:
#include <amxmodx> 

new bool:gReady[33] = false 
new bool:gReStart = false 
new gReadyNum 

public plugin_init() 
{ 
    register_plugin("Ready?","5.0","AssKicR") 
    register_clcmd("say","HandleSay") 
    register_cvar("sv_minplayers","9") 
} 

public HandleSay(id) 
{ 
    new gText[192] 
    read_args(gText, 192) 
    remove_quotes(gText) 

    if(containi(gText,"ready")!=-1) { 
        if(!gReady[id]) { 
            if(get_playersnum()>=get_cvar_num("sv_minplayers")) { 
                gReady[id] = true 
                gReadyNum += 1 
                client_print(0,print_chat,"[AMXX] %i/%i are Ready...",gReadyNum,get_playersnum()) 
            }else{ 
                client_print(id,print_chat,"[AMXX] Need more players to go live.") 
            } 
        }else{ 
            client_print(id,print_chat,"[AMXX] You are already Ready.") 
        } 
    } 
    
    if(containi(gText,"clearlive") !=-1) {
	    if(get_user_flags(id) & ADMIN_KICK) {
		    gReady[0] = false
		    gReadyNum = 0
		    client_print(0,print_chat,"[AMXX] Match is not live, Players are not Ready.")
	   }else{
		   client_print(id,print_chat,"[AMXX] You are not an admin.")
	   }
	}
		   

    if (gReadyNum==get_playersnum() && !gReStart) { 
        gReStart = true 
        client_print(0,print_chat,"[AMXX] GOING LIVE ON THREE RESTARTS") 
        //client_cmd(0,"spk ambience/siren.wav") //UNCOMMENT THIS LINE FOR A NICE SOUND EFFECT 
        set_task( 5.0, "RestartRound1" ) //first restart 
        set_task( 9.0, "RestartRound2" ) //second restart 
        set_task( 11.0,"RestartRound3" ) //final restart 
        set_task( 17.0,"goLIVE") //go live 
    }   
    
} 

public RestartRound1() { 
    server_cmd( "sv_restartround 1") 
} 

public RestartRound2() { 
    server_cmd( "sv_restartround 1") 
} 

public RestartRound3() { 
    server_cmd( "sv_restartround 5") 
} 

public goLIVE() { 
    client_print(0,print_chat,"[AMXX] MATCH IS NOW LIVE!") 
    client_print(0,print_center,"MATCH IS NOW LIVE!") 
    gReStart = false 
    for( new id=0 ; id>33 ; id++ ) 
        gReady[id]=false 
}
try this think that should work... just wrote a quick little segmet

SAY: clearlive to erase the ready... can't use notready since it looks for teh work ready
Da Bishop is offline
Send a message via MSN to Da Bishop
hellraser
Member
Join Date: Jul 2004
Old 09-12-2004 , 16:07  
Reply With Quote #6

Thx for your time dude, what i want is when a normal player has typed 'ready' he could type like 'stop' and the ready players counter would go -1! ??
hellraser is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 09-12-2004 , 16:26  
Reply With Quote #7

so if he were to say stop... just he isn't ready no more and count is -1 got it

Code:
#include <amxmodx> 

new bool:gReady[33] = false 
new bool:gReStart = false 
new gReadyNum 

public plugin_init() 
{ 
    register_plugin("Ready?","5.0","AssKicR") 
    register_clcmd("say","HandleSay") 
    register_cvar("sv_minplayers","9") 
} 

public HandleSay(id) 
{ 
    new gText[192] 
    read_args(gText, 192) 
    remove_quotes(gText) 

    if(containi(gText,"ready")!=-1) { 
        if(!gReady[id]) { 
            if(get_playersnum()>=get_cvar_num("sv_minplayers")) { 
                gReady[id] = true 
                gReadyNum += 1 
                client_print(0,print_chat,"[AMXX] %i/%i are Ready...",gReadyNum,get_playersnum()) 
            }else{ 
                client_print(id,print_chat,"[AMXX] Need more players to go live.") 
            } 
        }else{ 
            client_print(id,print_chat,"[AMXX] You are already Ready.") 
        } 
    } 
    
    if(containi(gText,"stop") !=-1) { 
       if(gReady[id]) {
	       gReady[id] = false
	       gReadyNum -= 1
	       client_print(id,print_chat,"[AMXX] You are now not ready.")
	       client_print(0,print_chat,"[AMXX] %i/%i are Ready now...",gReadyNum,get_playersnum())
		}else{
			client_print(id,print_chat,"[AMXX] You have not said Ready yet...")
		}
	}          

    if (gReadyNum==get_playersnum() && !gReStart) { 
        gReStart = true 
        client_print(0,print_chat,"[AMXX] GOING LIVE ON THREE RESTARTS") 
        //client_cmd(0,"spk ambience/siren.wav") //UNCOMMENT THIS LINE FOR A NICE SOUND EFFECT 
        set_task( 5.0, "RestartRound1" ) //first restart 
        set_task( 9.0, "RestartRound2" ) //second restart 
        set_task( 11.0,"RestartRound3" ) //final restart 
        set_task( 17.0,"goLIVE") //go live 
    }    
    
} 

public RestartRound1() { 
    server_cmd( "sv_restartround 1") 
} 

public RestartRound2() { 
    server_cmd( "sv_restartround 1") 
} 

public RestartRound3() { 
    server_cmd( "sv_restartround 5") 
} 

public goLIVE() { 
    client_print(0,print_chat,"[AMXX] MATCH IS NOW LIVE!") 
    client_print(0,print_center,"MATCH IS NOW LIVE!") 
    gReStart = false 
    for( new id=0 ; id>33 ; id++ ) 
        gReady[id]=false 
}
Da Bishop is offline
Send a message via MSN to Da Bishop
hellraser
Member
Join Date: Jul 2004
Old 09-12-2004 , 17:25  
Reply With Quote #8

Perfect m8,u're da man :d Thx
hellraser is offline
hellraser
Member
Join Date: Jul 2004
Old 09-13-2004 , 15:49  
Reply With Quote #9

There's like a bug or not really cause nothing is coded to stop it.
But if like sv_minplayers = 1 then if a player types stop it will do : gReadyNum -1...And there is no limit for gReadyNum so it can be < 0...
How could i do so
gReadyNum always >= 0 ??

Thx
hellraser is offline
[SNPR]Sega
Junior Member
Join Date: Sep 2004
Old 09-16-2004 , 03:09  
Reply With Quote #10

Cool plugin. I'm a fan. Thanks guys.
[SNPR]Sega 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 07:03.


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