Denis 1477 Posted February 11, 2014 Share Posted February 11, 2014 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Today i'll show you one ban panel that i have created with python & lua NOTE:For this quest you will need Mijago's Quest Library! Library Spoiler quest denic_cikiec begin state start begin when login with pc.get_name() == "[Admin]Denic" begin send_letter("Admin Panel") end when button or info begin if pc.get_name() == "[Admin]Denic" then say_title("Admin Panel") say("Please select an option:") local a = select("Close Client", "Warning", "Send Message", "Cancel") if a == 1 then say_title("Admin Panel - Close Client") say("Please enter the players name in the field.") local player_name = input() local u_vid = find_pc_by_name(player_name) if player_name == "" then say_title("Admin Panel") say("You have not enter the player's name!") return end if u_vid == 0 then say_title("Admin Panel") say_reward(string.format("The player: %s is not connected! ", player_name)) else local old = pc.select(u_vid) cmdchat("CloseClient "..player_name.."") pc.select(old) end end if a == 2 then say_title("Admin Panel - Warning/Ban") say_reward('If one player have already 3 warnings and you give him another one warning,') say_reward('his account will be banned permanent!') say("Please enter the players name in the field.") local player_name = input() local get_warnings = pc.getqf(player_name..'Warning') local u_vid = find_pc_by_name(player_name) if player_name == "" then say_title("Admin Panel") say("You have not enter the player's name!") return end if u_vid == 0 then say_title("Admin Panel") say_reward(string.format("The player: %s is not connected! ", player_name)) else say(string.format("The player: %s has %s warnings! ", player_name,get_warnings)) if get_warnings == 3 then say_reward(string.format('If you give this warning now the player: %s will be banned permanent!',player_name)) end local choiseSecond = select('Continue','Cancel') if choiseSecond == 2 then return end if choiseSecond == 1 then if get_warnings >= 3 then local a = mysql_query("SELECT * FROM player.player WHERE name='"..player_name.."'") local acc_id = a.account_id[1] mysql_query("UPDATE account.account SET status='BLOCK' WHERE id='"..acc_id.."'") command('dc '..player_name) end if get_warnings < 3 then local old = pc.select(u_vid) cmdchat("Warn "..player_name.."") pc.select(old) pc.setqf(player_name..'Warning',get_warnings+1) end end end end if a == 3 then say_title("Admin Panel") say("Enter the message you want with - and not spaces, (ex. Hello-World)") say("Please enter the players name in the field.") local player_name = input() local message = input() local u_vid = find_pc_by_name(player_name) if player_name == "" then say_title("Admin Panel") say("You have not enter the player's name!") return end if u_vid == 0 then say_title("Admin Panel") say_reward(string.format("The player: %s is not connected! ", player_name)) else local old = pc.select(u_vid) cmdchat("SendMessage "..player_name.." "..message.."") pc.select(old) end end end end end end After adding this quest to your server open game.py (root file) and search for string servercommandlist= you will see something like this: https://metin2.download/picture/aX2pwr71T7PLRjAhaj9k10sTTDmB7lY4/.png go to the end of functions and add: "CloseClient" : self.CloseClient, "Warn" : self.Warning, "SendMessage" : self.Message, and after adding them add these to the end of file: def CloseClient(self, player_name): if player_name == str(player.GetName()): import dbg,app dbg.LogBox("One GM has close your client!",'Client') app.Exit() def Warning(self, player_name): if player_name == str(player.GetName()): import os os.system("@echo off && title Warning && color 0a && echo You have take a warning in 3 warnings you get a permanent ban && pause") def Message(self, player_name, text): if player_name == str(player.GetName()): message = text.replace("-"," ") import dbg dbg.LogBox(message) and then test the quest Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal 36 1 1 2 13 1 4 36 Link to comment Share on other sites More sharing options...
HITRON 705 Posted February 11, 2014 Share Posted February 11, 2014 Cool. Thanks you for share this! 1 Link to comment Share on other sites More sharing options...
Yoshix3 8 Posted February 23, 2014 Share Posted February 23, 2014 A normal User can easy use this Panel, too. Link to comment Share on other sites More sharing options...
Premium Shogun 4614 Posted February 23, 2014 Premium Share Posted February 23, 2014 A normal User can easy use this Panel, too. how? it's being identified by name Link to comment Share on other sites More sharing options...
Yoshix3 8 Posted February 23, 2014 Share Posted February 23, 2014 You don´t need a letter, to start a Quest. 1 Link to comment Share on other sites More sharing options...
DasSchwarzeT 112 Posted February 23, 2014 Share Posted February 23, 2014 #delete ? Link to comment Share on other sites More sharing options...
Remix 45 Posted February 23, 2014 Share Posted February 23, 2014 I wrote how you could activate the panel without the specific name, but i dont want that anybody uses it to hurt other servers. 2 Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4951 Posted February 23, 2014 Bot Share Posted February 23, 2014 Consider making It more secure then. Link to comment Share on other sites More sharing options...
PauloFerreira 4 Posted February 24, 2014 Share Posted February 24, 2014 I think with this verification is impossible to "hack"... when button or info begin if pc.get_name() == "[Admin]Denic" then --execute the quest else say("dont try to hack the quest ") end Regards. 1 Link to comment Share on other sites More sharing options...
bitza12 0 Posted May 15, 2014 Share Posted May 15, 2014 Hello, i have one problem and one question: First, where can i find Mijago's Quest Library? And the problme: When i'm in login scrn i get this error in syser(client): 0515 23:19:36399 :: Traceback (most recent call last): 0515 23:19:36399 :: File "networkModule.py", line 237, in SetGamePhase 0515 23:19:36399 :: File "system.py", line 130, in __pack_import 0515 23:19:36399 :: File " 0515 23:19:36399 :: game.py 0515 23:19:36399 :: ", line 0515 23:19:36399 :: 2243 0515 23:19:36399 :: 0515 23:19:36399 :: 0515 23:19:36399 :: if player_name == str(player.GetName()): 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36400 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: 0515 23:19:36401 :: IndentationError 0515 23:19:36411 :: : 0515 23:19:36411 :: unindent does not match any outer indentation level 0515 23:19:36411 :: Link to comment Share on other sites More sharing options...
Frozen 189 Posted May 15, 2014 Share Posted May 15, 2014 In line 56 is "if choise == 1 then " , shouldnt be intead if choiseSecond == 1 then Link to comment Share on other sites More sharing options...
Premium Shogun 4614 Posted May 15, 2014 Premium Share Posted May 15, 2014 Hello, i have one problem and one question: First, where can i find Mijago's Quest Library? http://metin2dev.org/board/topic/30-mijagos-quest-functions/ Link to comment Share on other sites More sharing options...
Denis 1477 Posted May 18, 2014 Author Share Posted May 18, 2014 #Updated It's impossible now to open the menu without specified name Link to comment Share on other sites More sharing options...
Aemon 7 Posted May 19, 2014 Share Posted May 19, 2014 It works all 2 commands, "CloseClient" and "SendMessage", the "Warn" command isn't work. Link to comment Share on other sites More sharing options...
Denis 1477 Posted May 19, 2014 Author Share Posted May 19, 2014 I've fixed it now,check it and tell me if it'll works Link to comment Share on other sites More sharing options...
Aemon 7 Posted May 19, 2014 Share Posted May 19, 2014 (edited) Yes, now it works ! But if I give me 3 + 1 warnings I don't recive nothing. And here it say [ all time ] I have 0 warning Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Denis 1477 Posted May 19, 2014 Author Share Posted May 19, 2014 Yeah sorry,I've fixed it now Link to comment Share on other sites More sharing options...
Management Karbust 4926 Posted May 28, 2014 Management Share Posted May 28, 2014 Hi I tested this quest, but when I give 3 warnings at one player, the account who is blocked is the mine, but the other client take DC Can you fix this to ban the other player and not the mine??? Thanks Link to comment Share on other sites More sharing options...
Denis 1477 Posted May 28, 2014 Author Share Posted May 28, 2014 Try now it's should be ok Link to comment Share on other sites More sharing options...
Management Karbust 4926 Posted May 28, 2014 Management Share Posted May 28, 2014 still not work :S the account who is blocked was mine EDIT: now it's banning the correct account, but when I give the last warning I can't login again in the server with the account I used to warning, just rebooting the server I can login again :S Link to comment Share on other sites More sharing options...
Denis 1477 Posted May 28, 2014 Author Share Posted May 28, 2014 I don't know..I tested the quest on my test server and it's works fine Link to comment Share on other sites More sharing options...
Active Member Koray 2015 Posted September 16, 2014 Active Member Share Posted September 16, 2014 quest denic_cikiec begin state start begin when login with pc.get_name() == "[Admin]Denic" begin send_letter("Admin Panel") end when button or info begin if pc.get_name() == "[Admin]Denic" then when login with pc.is_gm() begin send_letter("Admin Panel") end when button or info begin if pc.is_gm() then now is better because get_name easily bypass as clientside Link to comment Share on other sites More sharing options...
Saud bin abdullah 7 Posted September 18, 2014 Share Posted September 18, 2014 when login with pc.getqf("ADMIN") == 1 begin now everyone will be professional thx for share Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted September 19, 2014 Share Posted September 19, 2014 quest denic_cikiec begin state start begin when login with pc.is_gm() and pc.get_name() == "[Admin]Denic" begin send_letter("Admin Panel") end the best Link to comment Share on other sites More sharing options...
djkotsos 101 Posted March 25, 2015 Share Posted March 25, 2015 0325 09:49:24018 :: Traceback (most recent call last): 0325 09:49:24316 :: File "networkModule.py", line 239, in SetGamePhase 0325 09:49:24350 :: File "system.py", line 130, in __pack_import 0325 09:49:24350 :: File " 0325 09:49:24350 :: <string> 0325 09:49:24350 :: ", line 0325 09:49:24350 :: 2138 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: if player_name == str(player.GetName()): 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24350 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: 0325 09:49:24351 :: ^ 0325 09:49:24351 :: IndentationError 0325 09:49:24351 :: : 0325 09:49:24351 :: unindent does not match any outer indentation level 0325 09:49:24351 :: Link to comment Share on other sites More sharing options...
Recommended Posts