amosth 9 Posted February 3, 2018 Share Posted February 3, 2018 (edited) quest vip begin state start begin when 40003.use begin if pc.count_item(40003)>=1 then say_title("Inel [VIP]") say("Vrei sa ai VIP in fata numelui") local a = select("Da!", "Nu") if a == 1 then local name = pc.get_name() local find_id = mysql_query("SELECT account_id from player.player WHERE name='"..name.."' LIMIT 1;") local id = find_id[1][1]+1-1 mysql_query("UPDATE player.player SET name='[VIP]"..name.."' WHERE account_id='"..id.."' LIMIT 1;") pc.remove_item(40003) syschat("Votre demande à été envoyé au serveur. Votre") syschat("changera dès que le serveur aura retourné l'information!") else return end else say_title("Inel [VIP]") say("Aveti Nevoie de") say("Inelul VIP pentru a activa numele:") say_item_vnum(40003) say("Intoarcete cand ai.") return end end end end Image error: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Solution Syreldar 1875 Posted February 3, 2018 Premium Solution Share Posted February 3, 2018 quest vip begin state start begin function IsAlreadyVIPName(name) return string.find(name, "[VIP]") ~= nil; end -- function when 40003.use begin say_title("Inel [VIP]:[ENTER]") say("Vrei sa ai VIP in fata numelui?[ENTER]") if (select("Da!", "Nu") == 1) then local id = pc.get_player_id(); local name = mysql_query(string.format("SELECT name FROM player.player WHERE id = %d;", id))[1][1]; say_title("Inel [VIP]:[ENTER]") if (vip.IsAlreadyVIPName(name)) then return say_reward("You are already VIP, you can't change your name.[ENTER]"); end -- if pc.remove_item(item.get_vnum(), 1); mysql_query(string.format("UPDATE player.player SET name = '[VIP]%s' WHERE id = %d;", name, id)); say("Votre demande à été envoyé au serveur. Votre") say("changera dès que le serveur aura retourné l'information!") end -- if end -- when end -- state end -- quest 1 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
amosth 9 Posted February 3, 2018 Author Share Posted February 3, 2018 It did not work, it's saying that you already have the VIP, but you do not have =/ Link to comment Share on other sites More sharing options...
Premium Syreldar 1875 Posted February 3, 2018 Premium Share Posted February 3, 2018 14 minutes ago, amosth said: It did not work, it's saying that you already have the VIP, but you do not have =/ function IsAlreadyVIPName(name) return string.find(name, "[VIP]") ~= nil; end -- function http://lua-users.org/wiki/StringLibraryTutorial Works perfectly. 1 "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
amosth 9 Posted February 4, 2018 Author Share Posted February 4, 2018 Good work ... I reviewed your work, this is correct. thanks very thanks #closerequest Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now