AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Event (https://forums.alliedmods.net/showthread.php?t=117000)

LostSkill 01-28-2010 07:44

Event
 
Can somebody expalin me this 2 event's? Couse now event works only for wining team. And i whana that it work for bouth teams... Lossing team and winning team...

PHP Code:

register_event("HLTV""event_new_round""a""1=0""2=0"
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w"


floatman 01-28-2010 07:48

Re: Event
 
http://wiki.alliedmods.net/Half-Life_1_Game_Events

LostSkill 01-28-2010 07:54

Re: Event
 
I dont see at there usefull information about this 2 event's...

Bugsy 01-28-2010 08:29

Re: Event
 
HLTV is explained in the above link:

"Note: On new round is fired with both arguments equal to 0."

register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

"HLTV" is the message being hooked
"event_new_round" is the function that gets called when conditions are met
"a" means global event
"1=0","2=0" means arguments 1 and 2 must equal 0 for the event_new_round function to get fired. This signifies new round

Arguments for TextMsg: http://forums.alliedmods.net/showpos...00&postcount=5

register_event("TextMsg","Event_RoundRestart" ,"a","2&#Game_w")

Everything is the same as above except the condition. For this we are looking to only call "Event_RoundRestart" if "#Game_w" is found in the 2nd parameter of the TextMsg message.

"2&#Game_w" means the 2nd parameter must contain "#Game_w".

The two messages that will trigger our message hook are:

#Game_will_restart_in_console
#Game_will_restart_in

Hope that helps

LostSkill 01-28-2010 10:41

Re: Event
 
Arguments rocks =] but still i dont get it why whit this even's only winning team get event not bouth teams ;/

Bugsy 01-28-2010 11:22

Re: Event
 
show your code

LostSkill 01-28-2010 12:17

Re: Event
 
PHP Code:

public event_new_round() 
{
    
round++;
    new 
players[32], playerpnum;
    
get_players(playerspnum"a");
    for(new 
0pnumi++)
    {
        
player players[i];
        if(
get_user_flags(player) & ADMIN_LEVEL_H)
        {
        if (!
get_pcvar_num(g_menu_active))
            return 
PLUGIN_CONTINUE
        
if(round 2)
        {
            
Showrod(player);
        }
        }
    }
    return 
PLUGIN_HANDLED
}

public 
Event_RoundRestart(id)
{
    
round=0;




All times are GMT -4. The time now is 12:24.

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