| 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(PLUGIN, VERSION, AUTHOR) 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(id, GREEN, "Da sakrijes hud detalje kucaj ^01/hide_hud") } else { ColorChat(id, GREEN, "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')? 0 : 1] = read_data(2)
return PLUGIN_CONTINUE }
public ShowHud() { new players[32],num, i,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", Servername, 31) get_mapname(currmap, 30) 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(0, 255, 0, 0.01, 0.25, 0, 6.0, 1.0) if(rounds == true) { if(roundsleft == 1) { show_hudmessage(id, "Server: %s^nCurrent Map: %s^nNextmap: %s^nMap will be changed after this round!",Servername, currmap, NextMap) } else { show_hudmessage(id, "Server: %s^nCurrent Map: %s^nNextmap: %s^%d rounds left",Servername, currmap, roundsleft) } 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!",Servername, currmap, NextMap) } else { show_hudmessage(id, "Server: %s^nCurrent Map: %s^nNextmap: %s^nTime Left: %d:%d",Servername, currmap, NextMap, iTimeLeft / 60, iTimeLeft % 60) } } return PLUGIN_HANDLED; }
|