Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include amxmodx
- #include amxmisc
- #include cstrike
- #include fakemeta
- #include hamsandwich
- #include csx
- #include SpecialGeoip
- #include fcs
- #define TASK_PRESENTS 1337
- #define TASK_SHOWHUD 2674
- #define ID_PRESENTS (TaskIndex - TASK_PRESENTS)
- #define ID_SHOWHUD (TaskIndex - TASK_SHOWHUD)
- new ammo[3][33],string[21],cvarShowType,ammopacks
- // Variabile
- new MesajSync, MesajSync2
- // Cvaruri
- new cvar_hudenable
- public plugin_init()
- {
- register_plugin("Hud Info", "1.1", "")
- // Register Cvars
- cvar_hudenable = register_cvar("credits_hudstats", "1")
- // Register Messages
- MesajSync = CreateHudSyncObj()
- MesajSync2 = CreateHudSyncObj()
- register_message(get_user_msgid("SayText"), "message")
- register_event("DeathMsg","death_msg","a")
- register_logevent("round_start", 2, "1=Round_Start")
- cvarShowType = register_cvar("ac_show_type", "1")
- register_clcmd("say /change","func_change",ADMIN_ALL,"")
- }
- public round_start() {
- new players[32],num,i
- get_players(players,num)
- for(i=1;i<num;i++) {
- ammo[0][players[i]] = fcs_get_user_credits(players[i])
- }
- }
- public client_putinserver(id)
- {
- set_task(1.0, "MesajHUD", id+TASK_SHOWHUD, .flags = "b")
- set_task(3.0,"func_ammo",id)
- return 1;
- }
- public death_msg()
- {
- new iKiller = read_data ( 1 );
- new iVictim = read_data ( 2 );
- if ( iKiller == iVictim ) return 1;
- fcs_set_user_credits ( iKiller, fcs_get_user_credits ( iKiller ) + 1 );
- return 1;
- }
- public func_ammo(id) {
- ammopacks = fcs_get_user_credits(id)
- ammo[0][id] = ammopacks
- ammo[1][id] = ammopacks
- ammo[2][id] = ammopacks
- set_task(1.0,"change_ammo",id,_,_,"b")
- }
- public change_ammo(id) {
- if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
- return PLUGIN_HANDLED
- ammo[1][id] = fcs_get_user_credits(id)
- if(ammo[1][id] != ammo[2][id]) {
- if(ammo[1][id] > ammo[2][id]) {
- ammopacks = ammo[1][id] - ammo[2][id]
- format(string,charsmax(string),"[ +%d Gold ]", ammopacks)
- }
- else {
- ammopacks = ammo[2][id] - ammo[1][id]
- format(string,charsmax(string),"[ -%d Gold ]", ammopacks)
- }
- ammo[2][id] = ammo[1][id]
- if(get_pcvar_num(cvarShowType)) {
- set_hudmessage(180, 180, 180, 0.51, 0.51, 0, 6.0, 3.0,_,_,3)
- show_hudmessage(id, "%s", string)
- }
- else
- client_print(id, print_center, "%s", string)
- }
- return PLUGIN_HANDLED
- }
- public client_disconnect(id) {
- ammo[0][id] = 0
- ammo[1][id] = 0
- ammo[2][id] = 0
- remove_task(id)
- }
- public MesajHUD(TaskIndex)
- {
- static id
- id = ID_SHOWHUD;
- if (!is_user_alive(id))
- {
- id = pev(id, pev_iuser2)
- if(!is_user_alive(id)) return;
- }
- if (get_pcvar_num(cvar_hudenable))
- {
- if(id != ID_SHOWHUD)
- {
- new nume[32], szcountry[128], szcity[128];
- get_user_name(id, nume, 31)
- GetClientGeoData(id, CountryName, szcountry, 127)
- GetClientGeoData(id, City, szcity, 127)
- set_hudmessage(0, 100, 250, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1)
- //ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nHP: %d - Golds: %d^nFrom: %s , %s", nume, pev(id, pev_health), fcs_get_user_credits[id], szcountry, szcity)
- ShowSyncHudMsg(ID_SHOWHUD, MesajSync, "Spectating %s^nHP: %d - Gold: %d^nFrom: %s, %s", nume, get_user_health ( id ), fcs_get_user_credits ( id ), szcountry, szcity )
- }
- else
- {
- set_hudmessage(0, 100, 250, 0.88, 0.83, 0, 6.0, 1.1, 0.0, 0.0, -1)
- ShowSyncHudMsg(ID_SHOWHUD, MesajSync2, "Gold^n --%d-- ", fcs_get_user_credits(ID_SHOWHUD))
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement