[Problem] Steam Damager
Results 1 to 5 of 5

Thread: Steam Damager

  1. #1
    Senior Member Array
    Join Date
    Mar 2010
    Location
    Serbia
    Age
    22
    Karma
    21

    Default Steam Damager

    Pozdrav,

    Da li može neko da vidi šta se dešava sa kodom, testirao sam sa botovima i prikazuje mi kolko skidam protivniku, dok na online serveru ne pokazuje, samo koliko meni protivnik nanosi uz to pokazuje mi koliko nanosim štete samo kada sam sebi bacim nade npr, baš čudno
    sma:
    Code:
    #include <amxmodx>
    #include <hamsandwich>
    #include <fun>
    #include <fakemeta>
    #include <amxmisc>
     
    #define INFO_DELAY 15.0
     
    new g_MsgSync
    new g_MsgSync2
     
    new pid
    new damage
     
    new player_name[32]
    new bool:isStartPlugin[32] = false
    new roundCounter[32] = 0
     
    public plugin_init()
    {
       register_plugin("Bonus Steam Damager", "1.0", "")
       RegisterHam(Ham_Spawn,"player","start_bonus",1)
       register_event("Damage", "EventDamage", "b", "2!0", "3=0", "4!0")
        
       g_MsgSync = CreateHudSyncObj()
       g_MsgSync2 = CreateHudSyncObj()
        
    }
     
    public client_putinserver(id)
    {
       if(is_user_steam(id)){
          set_task(INFO_DELAY, "bonus_info", id)
       }
       if(is_user_steam(id) || is_user_admin(id)){
          isStartPlugin[id] = true
       }
    }
     
    public bonus_info(id){
       get_user_name(id,player_name,31)
       //set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.9, -1)
       set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.5, -1)
       show_hudmessage(id, "Hi %s!^nSTEAM Player ^nYou have some privilegies:^n+ Grenade^n+ Damager ^n",player_name)
    }
     
    public start_bonus(id){
       
       if(isStartPlugin[id] && is_user_alive(id)){
          give_item(id,"weapon_hegrenade")
          if(roundCounter[id] < 3){
             //set_hudmessage(34, 139, 34, 0.02, 0.25, 2, 0.1, 4.0, 0.03, 1.5, 1)
             //show_hudmessage(id, "You got:^nGrenade^nDamager (Show damaging)!",player_name)
             roundCounter[id] += 1
          }
       }
    }
    
    public EventDamage(id)
    {
       if(pev_valid(id))
       {
          pid = get_user_attacker(id)
          damage = read_data(2)
              
          if(isStartPlugin[id])
          {
             set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
             ShowSyncHudMsg(id, g_MsgSync2, "%i", damage)
              
             if(33>pid>0 && isStartPlugin[pid])
             {
                set_hudmessage(0, 250, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                ShowSyncHudMsg(pid, g_MsgSync, "%i", damage)
             }
          }
       }
    }
     
    public client_disconnect(id){
       isStartPlugin[id] = false
    }
     
    stock bool:is_user_steam(id)
    {
    // Author Sh0oter
            static dp_pointer
            if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
            {
                server_cmd("dp_clientinfo %d", id)
                server_exec()
                return (get_pcvar_num(dp_pointer) == 2) ? true : false
            }
            return false
    }
    Last edited by sanimare; 19-05-2018 at 12:05.

  2. #2
    Senior Member Array
    Join Date
    Mar 2010
    Location
    Serbia
    Age
    22
    Karma
    21

    Default

    Otkrio sam da prikazuje samo kad nanosim protivniku koji je na STEAM-u to treba da se reši, zato mi je pokazivalo kad sam sebi bacim nade.
    Last edited by sanimare; 19-05-2018 at 12:03.

  3. #3
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    11

    Default

    Code:
    #include <amxmodx>
    #include <hamsandwich>
    #include <fun>
    #include <fakemeta>
    #include <amxmisc>
     
    #define INFO_DELAY 15.0
     
    new g_MsgSync
    new g_MsgSync2
     
    new pid
    new damage
     
    new player_name[32]
    new bool:isStartPlugin[32] = false
    new roundCounter[32] = 0
     
    public plugin_init()
    {
       register_plugin("Bonus Steam Damager", "1.0", "")
       RegisterHam(Ham_Spawn,"player","start_bonus",1)
       register_event("Damage", "EventDamage", "b", "2!0", "3=0", "4!0")
        
       g_MsgSync = CreateHudSyncObj()
       g_MsgSync2 = CreateHudSyncObj()
        
    }
     
    public client_putinserver(id)
    {
       set_task(INFO_DELAY, "bonus_info", id)
    
       if(is_user_admin(id))
    {
          isStartPlugin[id] = true
       }
    }
     
    public bonus_info(id){
       get_user_name(id,player_name,31)
       //set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.9, -1)
       set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.5, -1)
       show_hudmessage(id, "Hi %s!^nSTEAM Player ^nYou have some privilegies:^n+ Grenade^n+ Damager ^n",player_name)
    }
     
    public start_bonus(id){
       
       if(isStartPlugin[id] && is_user_alive(id)){
          give_item(id,"weapon_hegrenade")
          if(roundCounter[id] < 3){
             //set_hudmessage(34, 139, 34, 0.02, 0.25, 2, 0.1, 4.0, 0.03, 1.5, 1)
             //show_hudmessage(id, "You got:^nGrenade^nDamager (Show damaging)!",player_name)
             roundCounter[id] += 1
          }
       }
    }
    
    public EventDamage(id)
    {
       if(pev_valid(id))
       {
          pid = get_user_attacker(id)
          damage = read_data(2)
              
          if(isStartPlugin[id])
          {
             set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
             ShowSyncHudMsg(id, g_MsgSync2, "%i", damage)
              
             if(33>pid>0 && isStartPlugin[pid])
             {
                set_hudmessage(0, 250, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                ShowSyncHudMsg(pid, g_MsgSync, "%i", damage)
             }
          }
       }
    }
     
    public client_disconnect(id){
       isStartPlugin[id] = false
    }
    Corona Pub official site: corona-cs.mojkgb.com
    Na serveru imamo malo drugaciji top(rank) koji ujedno moze da se prati sa sajta, budite stalni jer uskoro idu nagrade a i turnir!


  4. #4
    Senior Member Array
    Join Date
    Mar 2010
    Location
    Serbia
    Age
    22
    Karma
    21

    Default

    Isto ne prikazuje kolko sam naneo.
    Ja sam rešio ovako i radi, ne znam koliko je dobro ali samo sam jednu liniju promenio:
    Code:
    #include <amxmodx>
    #include <hamsandwich>
    #include <fun>
    #include <fakemeta>
    #include <amxmisc>
     
    #define INFO_DELAY 15.0
     
    new g_MsgSync
    new g_MsgSync2
     
    new pid
    new damage
     
    new player_name[32]
    new bool:isStartPlugin[32] = false
    new roundCounter[32] = 0
     
    public plugin_init()
    {
       register_plugin("Bonus Steam Damager", "1.0", "")
       RegisterHam(Ham_Spawn,"player","start_bonus",1)
       register_event("Damage", "EventDamage", "b", "2!0", "3=0", "4!0")
        
       g_MsgSync = CreateHudSyncObj()
       g_MsgSync2 = CreateHudSyncObj()
        
    }
     
    public client_putinserver(id)
    {
       if(is_user_steam(id)){
          set_task(INFO_DELAY, "bonus_info", id)
       }
       if(is_user_steam(id) || is_user_admin(id)){
          isStartPlugin[id] = true
       }
    }
     
    public bonus_info(id){
       get_user_name(id,player_name,31)
       //set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.9, -1)
       set_hudmessage(34, 139, 34, 0.1, 0.5, 2, 0.1, 4.0, 0.03, 0.5, -1)
       show_hudmessage(id, "Hi %s!^nSTEAM Player ^nYou have some privilegies:^n+ Grenade^n+ Damager ^n",player_name)
    }
     
    public start_bonus(id){
       //Запуск привилегий
       if(isStartPlugin[id] && is_user_alive(id)){
          give_item(id,"weapon_hegrenade")
          if(roundCounter[id] < 3){
             //set_hudmessage(34, 139, 34, 0.02, 0.25, 2, 0.1, 4.0, 0.03, 1.5, 1)
             //show_hudmessage(id, "You got:^nGrenade^nDamager (Show damaging)!",player_name)
             roundCounter[id] += 1
          }
       }
    }
    
    public EventDamage(id)
    {
       if(pev_valid(id))
       {
          pid = get_user_attacker(id)
          damage = read_data(2)
              
          if(33>pid>0 && isStartPlugin[pid])
          {
             set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
             ShowSyncHudMsg(id, g_MsgSync2, "%i", damage)
              
             if(33>pid>0 && isStartPlugin[pid])
             {
                set_hudmessage(0, 250, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
                ShowSyncHudMsg(pid, g_MsgSync, "%i", damage)
             }
          }
       }
    }
     
    public client_disconnect(id){
       isStartPlugin[id] = false
    }
     
    stock bool:is_user_steam(id)
    {
    // Author Sh0oter
            static dp_pointer
            if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
            {
                server_cmd("dp_clientinfo %d", id)
                server_exec()
                return (get_pcvar_num(dp_pointer) == 2) ? true : false
            }
            return false
    }

  5. #5
    Senior Member Array
    Join Date
    Mar 2010
    Location
    Serbia
    Age
    22
    Karma
    21

    Default

    Ovo nekad radi kako treba, nekad ne, ima li trajnog rešenja, treba mi inače za DM?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •