AlliedModders

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

Artifact 05-02-2012 10:35

Somethings wrong...
 
This plug wort property but when I put Roundsleft plugin, then plugin wont to show me how many rounds left...
PHP Code:

#include <amxmodx>
#include <colorchat>

#define PLUGIN "hud"
#define VERSION "1.5"
#define AUTHOR "good."

new showhudmessage[33], g_teamScore[3]
new 
bool:advert
new bool:rounds

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    if(
is_plugin_loaded("Roundsleft"))
    {
        
rounds true
    
}
    else
    {
        
rounds false
    
}
    
    
register_clcmd("say /show_hud","Show_Hud")
    
register_clcmd("say /hide_hud","Hide_Hud")
    
    
set_task(1.0"ShowHud",.flags "b")
    
set_task(2.0"Advert",_,_,_,"b")
}
public 
client_connect(id)
{
    
showhudmessage[id] = true
    advert 
true
}

public 
Show_Hud(id)
{
    
showhudmessage[id] = true
    advert 
true
}
public 
Hide_Hud(id

    
showhudmessage[id] = false
    advert 
false
}

public 
Advert(id)
{
    if(
advert == true)
    {
        
ColorChat(idGREEN"Da sakrijes hud detalje  kucaj ^01/hide_hud")
    }
    else
    {
        
ColorChat(idGREEN"Da aktiviras hud detalje sa leve strane kucaj ^01/show_hud")
    }
}

public 
teamScore(id) {
    new 
team[2]
    
read_data(1,team,1)
    
g_teamScore[(team[0]=='C')? 1] = read_data(2)

    return 
PLUGIN_CONTINUE
}

public 
ShowHud()
{
    new 
players[32],numi,id
    get_players
(players,num)
    
    for(
i=0;i<num;i++)
    {
        
id players[i]
        
        if(!
showhudmessage[id]) continue
        
        static 
currmap[31]
        new 
NextMap[32]
        static 
Servername[32]
        
get_cvar_string("hostname"Servername31)
        
get_mapname(currmap30)
        
get_cvar_string"amx_nextmap" NextMap 31 );
        new 
iTimeLeft get_timeleft();
        
        new 
maxRounds get_cvar_num("mp_maxrounds")
        new 
roundsleft maxRounds - (g_teamScore[0] + g_teamScore[1])
        
        
set_hudmessage(025500.010.2506.01.0)
        if(
rounds == true)
        {
            if(
roundsleft == 1)
            {
                
show_hudmessage(id"Server: %s^nCurrent Map: %s^nNextmap: %s^nMap will be changed after this round!",ServernamecurrmapNextMap)
            }
            else
            {
                
show_hudmessage(id"Server: %s^nCurrent Map: %s^nNextmap: %s^%d rounds left",Servernamecurrmaproundsleft)
            }
            return 
PLUGIN_HANDLED;
        }
        if(
get_cvar_num("mp_timelimit") == 0)
        {
            
show_hudmessage(id"Server: %s^nCurrent Map: %s^nNextmap: %s^nMap will be changed after this round!",ServernamecurrmapNextMap)
        }
        else
        {
            
show_hudmessage(id"Server: %s^nCurrent Map: %s^nNextmap: %s^nTime Left: %d:%d",ServernamecurrmapNextMapiTimeLeft 60iTimeLeft 60)
        }
    }
    return 
PLUGIN_HANDLED;




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

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