• Shoutbox
    Active Users: 0
     
  • Notice: N/A
    Loading...
 
  • Active Users
     
  • There are currently no users chatting.
 
Results 1 to 8 of 8
  1. #1

    Help with scripting please

    Hi folks, I run a mohaa ft server and I would like to add a player kills & deaths counter to my server but am clueless as to how to go about it. I have seen the kills & deaths counter on other servers. My server runs Mefy's freezetag mod 1.3.2 and I have the reborn patch installed as well. Would any of you talented server operators be willing to assist me? Any help you can shoot my way will be greatly appreciated.


    Thanks in advance

    Max
    Last edited by Max; 05-17-2019 at 07:49 PM.

  2. #2
    Quote Originally Posted by Max View Post
    Hi folks, I run a mohaa ft server and I would like to add a player kills & deaths counter to my server but am clueless as to how to go about it. I have seen the kills & deaths counter on other servers. My server runs Mefy's freezetag mod 1.3.2 and I have the reborn patch installed as well. Would any of you talented server operators be willing to assist me? Any help you can shoot my way will be greatly appreciated.


    Thanks in advance

    Max
    Howdy,
    What kind of "kills and deaths counter" do you mean?
    like melt points result in adding kills to the player?
    or something like this screenshot (top right)?
    Email: hidemyemail.co/e/ryback
    fb: fb.com/651616m689732315949

  3. #3
    Thanks for your response RyBack. The screenshot you provided isn't what I'm looking for. I don't need it so detailed. I will add a couple of screenshots to show you what I'm looking for. Example 1 is more to my liking. Adding melt rewards would be cool though, like adding 1 kill for every 2/3 melts. I tried the mod "Reborn Streak Rewards" and didn't like it, don't care for withholding weapons until you get to a certain amount of kills/melts plus it was to large on my screen. I would really appreciate any help and/or guidance you could offer. I found on http://www.x-null.net/wiki/index.php...pting_Commands under "getkills" & "getdeaths" codes but don't have a clue as to how to implement on my server. Maybe you or one of the other members here does.

    Max
    Example.jpg
    example2.jpg
    Last edited by Max; 05-19-2019 at 02:21 PM.

  4. #4
    Administrator Major_A's Avatar
    Join Date
    Jul 2016
    Location
    Huntington, IN USA
    Posts
    391
    Trophies
    Blog Entries
    15
    I'd be interested in seeing how that's done as well.

    I know it's a huddraw thing, but don't know if the kills /deaths are a playerstat or cvar link.



  5. #5
    Having not actually played around with Reborn, I'm not certain of this solution, and I don't have it installed so can't test this (plus don't have a great deal of time atm), but...

    What about using the Reborn event system to check for player deaths, which I know grabs the attacker and the victim?

    So, for example, you'd register the event at every map start in a script:

    Code:
    	local.result = registerev kill global/example.scr::kill
    And then in "global/example.scr" file you have:

    Code:
    kill local.attacker local.damage local.inflictor local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.player:
    
    	local.attacker thread UpdateKDCounter // add to this player's kills 
    	local.player thread UpdateKDCounter // add to this player's deaths
    
    end
    
    UpdateKDCounter:
    
    	local.player_kills = self getkills
    	local.player_deaths = self getdeaths
    
    	// huddraw code here using player_deaths and player_kills
    
    end
    Something like that? And I guess use a connection or spawn event to start the counter at 0 / 0.

    Probably best for RyBack to respond with his solution though, as I think he agreed to help out and he'll know Reborn better than me.
    Last edited by 1337Smithy; 05-20-2019 at 08:01 AM.

  6. #6
    I found the following code on http://www.x-null.net/wiki/index.php...pting_Commands but to be honest, it's all just gibberish to me. It seems to me there should be more to it than what's there, and also where would that code be placed?
    GET KILLS
    local.player_kills = $player[1] getkills

    or

    local.player_kills = $player[1] getkills( )
    Result:
    Code:
    Number of players that this player has killed.

    ************************************************** *****
    GET DEATHS
    local.player_deaths = $player[1] getdeaths

    or

    local.player_deaths = $player[1] getdeaths( )
    Result:
    Code:
    Number of player's deaths.

  7. #7
    Quote Originally Posted by 1337Smithy View Post
    Having not actually played around with Reborn, I'm not certain of this solution, and I don't have it installed so can't test this (plus don't have a great deal of time atm), but...

    What about using the Reborn event system to check for player deaths, which I know grabs the attacker and the victim?

    So, for example, you'd register the event at every map start in a script:

    Code:
        local.result = registerev kill global/example.scr::kill
    And then in "global/example.scr" file you have:

    Code:
    kill local.attacker local.damage local.inflictor local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.player:
    
        local.attacker thread UpdateKDCounter // add to this player's kills 
        local.player thread UpdateKDCounter // add to this player's deaths
    
    end
    
    UpdateKDCounter:
    
        local.player_kills = self getkills
        local.player_deaths = self getdeaths
    
        // huddraw code here using player_deaths and player_kills
    
    end
    Something like that? And I guess use a connection or spawn event to start the counter at 0 / 0.

    Probably best for RyBack to respond with his solution though, as I think he agreed to help out and he'll know Reborn better than me.
    You're right, this is the optimum way to do it.

    Code:
    main:
        local.result = registerev kill global/kd_counter.scr::kill
        local.result = registerev connected global/kd_counter.scr::connected
    end
    
    connected local.player:
        local.player thread UpdateKDCounter
    end
    
    kill local.attacker local.damage local.inflictor local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.player:
    
        local.attacker thread UpdateKDCounter // add to this player's kills 
        local.player thread UpdateKDCounter // add to this player's deaths
    
    end
    
    UpdateKDCounter:
    
        local.player_kills = self getkills
        local.player_deaths = self getdeaths
    
        // huddraw code here using player_deaths and player_kills
        ihuddraw_align self 77 "left" "center" //alignment
        ihuddraw_alpha self 77 1 //opacity
        ihuddraw_color self 77 1 0 0 //color: red green blue
        ihuddraw_font self 77 "verdana-12" //font
        ihuddraw_rect self 77 20 0 50 20 //xpos ypos xsize ysize
        ihuddraw_virtualsize self 77 1 //should always be 1
        ihuddraw_string self 77 ("K/D: " + local.player_kills + "/" + local.player_deaths)
        
    end


    place the code in a file named global/kd_counter.scr and exec it from dmprecache.
    if you have troubles integrating it with your current mods, just upload them.
    Email: hidemyemail.co/e/ryback
    fb: fb.com/651616m689732315949

  8. #8
    Thanks fellows and especially you RyBack for providing the code. The code works perfectly.

Posting Permissions

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