7.2 Weapon & armor repeated change bug

02/04/2020 11:55 xBBB#1
Hello everyone. As you may already know, I am hosting a 7.2 rappelz server. Some players use this common bug to cause a lag inside the server. Do any of you know a solution for this problem? I have already searched in the forums but didn't find an answer. Thanks.
02/04/2020 12:34 アルカード#2
Quote:
Originally Posted by xBBB View Post
Hello everyone. As you may already know, I am hosting a 7.2 rappelz server. Some players use this common bug to cause a lag inside the server. Do any of you know a solution for this problem? I have already searched in the forums but didn't find an answer. Thanks.
1.Use HELP thread

[Only registered and activated users can see links. Click Here To Register...]


2.There is script to kick them or petrify them if they abuse it.


3.Check step 1.
02/04/2020 12:53 ThunderNikk#3
Help thread is not necessary that is why it has been unstuck.

Ill post a script I have in my luas later tonight.
02/04/2020 13:57 xBBB#4
Quote:
Originally Posted by ThunderNikk View Post
Help thread is not necessary that is why it has been unstuck.

Ill post a script I have in my luas later tonight.
I will be waiting, thanks!
02/05/2020 20:31 xBBB#5
I am sorry, but I didn't find the solution yet. I've searched in the help thread, but it's way too long and I already tried to use the "Search in Thread" button, but it doesn't display any results. Any help would be appreciated.
02/05/2020 23:12 ThunderNikk#6
I am sorry I forgot about you last night.

Add the following script to ETC_Script_Functions.lua...

Code:
function on_set_weapon_change()
    local pname = tostring(gv("name"))
    local changeTime = get_global_variable("change_weapontime"..pname)
    local change = tonumber(get_global_variable("changeweapon"..pname))
    if changeTime == "" then 
        changeTime = 0 
    end
    if change == "" or change == nil then 
        change = 0 
    end
    if (get_os_time() - changeTime) <= 2 then
        set_global_variable("changeweapon"..pname, change + 1)
        set_global_variable("change_weapontime"..pname, get_os_time())
        if change > 10 then 
            kick(pname)
        end
    else
        set_global_variable("change_weapontime"..pname, get_os_time())
        del_global_variable("changeweapon"..pname)
    end
end
02/06/2020 15:25 xBBB#7
Quote:
Originally Posted by ThunderNikk View Post
I am sorry I forgot about you last night.

Add the following script to ETC_Script_Functions.lua...

Code:
function on_set_weapon_change()
    local pname = tostring(gv("name"))
    local changeTime = get_global_variable("change_weapontime"..pname)
    local change = tonumber(get_global_variable("changeweapon"..pname))
    if changeTime == "" then 
        changeTime = 0 
    end
    if change == "" or change == nil then 
        change = 0 
    end
    if (get_os_time() - changeTime) <= 2 then
        set_global_variable("changeweapon"..pname, change + 1)
        set_global_variable("change_weapontime"..pname, get_os_time())
        if change > 10 then 
            kick(pname)
        end
    else
        set_global_variable("change_weapontime"..pname, get_os_time())
        del_global_variable("changeweapon"..pname)
    end
end
Thank you very much, but when I tried the script, it didn't work. I believe it's because of get_os_time() script is not defined in 7.2
02/06/2020 15:40 Musta²#8
Quote:
Originally Posted by xBBB View Post
Thank you very much, but when I tried the script, it didn't work. I believe it's because of get_os_time() script is not defined in 7.2
For older epics, get_os_time() is os.time() due to lua version used.
02/09/2020 12:47 xBBB#9
Thanks everyone! It worked perfectly.
02/09/2020 13:04 MohcenMaher#10
why would use all of that hhhh,
just put the weapons script_text to : "on_equip_item"
a function with the following arguments : "on_equip_item(code, target_type, user_handle, arg1, arg2, wear_pos) " will be executed, put any time checking there :)