AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round End HUD HELP!! (https://forums.alliedmods.net/showthread.php?t=116836)

shuttle_wave 01-26-2010 23:39

Round End HUD HELP!!
 
here it my code i get errors when compile need HELP!!


PHP Code:

#include <amxmodx>
#include <amxmisc>

#define MAX_PLAYERS 32

#define VERSION "1.0"

// Players Bool
new bool:g_bAlive[MAX_PLAYERS+1];

// Global Variables
new g_iMaxPlayers;

// Variables
new g_msgSyncGeneral;

public 
plugin_init() 
{
    
register_plugin(".::LG::. RoundEnd HUD"VERSION"Shuttle_Wave")
    
    
// Roundend Messages/Sounds
    
register_logevent("eLogRoundEnd"2"1=Round_End");
    
    
register_message(get_user_msgid("TextMsg"), "msgTextMsg");
    
    
// Sync Hud Message (general)
    
g_msgSyncGeneral CreateHudSyncObj();            // -1
    
    // Get Maxplayers
    
g_iMaxPlayers get_maxplayers();
}

// Block terrorist, counter-terrorist, round-draw, and restart messages
public msgTextMsg()
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsgcharsmax(textmsg));
    
    
// Game restarting, block message and replace with our own
    
if(equal(textmsg"#Game_will_restart_in") || equal(textmsg"#Game_Commencing") )
    {

    
// Terrorist or Guards won, block message and replace with our own
    
else if(equal(textmsg"#Hostages_Not_Rescued") || equal(textmsg"#Round_Draw") || equal(textmsg"#Terrorists_Win") || equal(textmsg"#CTs_Win") )
    }
}

public 
eLogRoundEnd()
{
    if(!
fnGetAliveTeamCount(CS_TEAM_T) && ( fnGetAliveTeamCount(CS_TEAM_CT) != ) )
    {
        {
            
// Guards Win
            
set_hudmessage(0100255, -1.0, -1.000.03.02.01.0, -1);
            
ShowSyncHudMsg(0g_msgSyncGeneral"Guards Win!^n^nAll Prisoners were killed...");
        }
    }

    
// Send the custom message, providing it's enabled
    
else if(!fnGetAliveTeamCount(CS_TEAM_CT) && ( fnGetAliveTeamCount(CS_TEAM_T) != ) )
    {
        
// Prisoners Win
        
set_hudmessage(25518030, -1.0, -1.000.03.02.01.0, -1);
        
ShowSyncHudMsg(0g_msgSyncGeneral"Prisoners Win!^n^nAll Guards were killed in action");
    }
    
    else
    {
        {
            
// No-one Won
            
set_hudmessage(02550, -1.0, -1.000.03.02.01.0, -1);
            
ShowSyncHudMsg(0g_msgSyncGeneral"No one won");
        }
    }
}

// Function to get alive team count
fnGetAliveTeamCount(CsTeams:Team)
{
    new 
iCount 0;
    for(new 
1<= g_iMaxPlayersi++)
    {
        if( ( 
g_bAlive[i] ) && ( cs_get_user_team(i) == Team ) )
            ++
iCount;
    }
    
    return 
iCount;



YamiKaitou 01-26-2010 23:46

Re: Round End HUD HELP!!
 
You are missing the code to execute if Line 44 evaluates to true

EDIT: Line 41 has no matching closing brace

shuttle_wave 01-27-2010 00:00

Re: Round End HUD HELP!!
 
someone fix it 4 me. i fixed the brackets

YamiKaitou 01-27-2010 00:08

Re: Round End HUD HELP!!
 
No you didn't, you just stuck it there without even trying....

PHP Code:

// Block terrorist, counter-terrorist, round-draw, and restart messages
public msgTextMsg()
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsgcharsmax(textmsg));
    
    
// Game restarting, block message and replace with our own
    
if(equal(textmsg"#Game_will_restart_in") || equal(textmsg"#Game_Commencing") )
    {
        
// put something here
    
}
    
// Terrorist or Guards won, block message and replace with our own
    
else if(equal(textmsg"#Hostages_Not_Rescued") || equal(textmsg"#Round_Draw") || equal(textmsg"#Terrorists_Win") || equal(textmsg"#CTs_Win") )
    {
        
// put something here
    
}




All times are GMT -4. The time now is 07:19.

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