bloody 0 Posted February 22, 2017 Share Posted February 22, 2017 Hello i have a problem with a quest for change name i tried all possible for change at that quest but doesn't change anithing i tried to change that function pc.change_name("VIP") like this just to see if work but doesn't. Aici sunt questurile quest vipchange begin state start begin when 40003.use begin say_title("[VIP] Nume") say("") say("Doresti sa ai [VIP]") say("in fata numelui?") local change = select("Da", "Nu") if change == 2 then return elseif change == 1 then local name = pc.get_name() pc.change_name("[VIP]""..name..") say_title("[VIP] Nume") say("") say("Te rog delogheazate pentru 10 minute.") say("Daca te loghezi mai repede") say("numele tau nu se va schimba..") end end end end Quest can be compiled in putty with ./qc but doesn't work... And after i tried this quest 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 And i have this problem mysql: ambiguous option '--e=SELECT account_id from player.player WHERE name='Kaden' LIMIT 1;' (enable_cleartext_plugin, execute) si acest warning Mysql warning "password on the command line . Mentioning i use server with source 40k. Sorry for my bad english. thank you in advance . Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 Hi, I just wrote this for you, adapt it as you like. View down Please keep in mind that the ret checks are ALWAYS necessary for the pc.change_name function, they can tell you what's going on and if there are any problems with it. "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...
apocalyptic 4 Posted February 22, 2017 Share Posted February 22, 2017 ee bnnn caline , postezi , dar game-u nu mi-l dai fmm. Link to comment Share on other sites More sharing options...
bloody 0 Posted February 22, 2017 Author Share Posted February 22, 2017 Thank you for help but i have this problem when i use item ingame: say("The change_name function is blocked for") say("this locale.[ENTER]") What i need to do? Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 4 minutes ago, bloody said: Thank you for help but i have this problem when i use item ingame: say("The change_name function is blocked for") say("this locale.[ENTER]") What i need to do? change_name is disabled on GF locales. You need to go into the source and unlock it, else it will always return ret == 5, which means it will not work. "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...
bloody 0 Posted February 22, 2017 Author Share Posted February 22, 2017 Where should i search to unlock change name? Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 4 minutes ago, bloody said: Where should i search to unlock change name? // ¸®ÅÏ°ª // 0: »õÀ̸§À» ¼³Á¤ÇÑ µÚ ·Î±×¾Æ¿ôÀ» ¾ÈÇßÀ½ // 1: ½ºÅ©¸³Æ®¿¡¼ ¹®ÀÚ¿ÀÌ ³Ñ¾î¿ÀÁö ¾Ê¾ÒÀ½ // 2: check_name À» Åë°úÇÏÁö ¸øÇßÀ½ // 3: ÀÌ¹Ì °°Àº À̸§ÀÌ »ç¿ëÁß // 4: ¼º°ø // 5: ÇØ´ç ±â´É Áö¿øÇÏÁö ¾ÊÀ½ if (!g_enable_pc_change_name) { lua_pushnumber(L, 5); return 1; } Search and delete this check. "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...
bloody 0 Posted February 22, 2017 Author Share Posted February 22, 2017 Thank you very much! You are my savior! Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 1 minute ago, bloody said: Thank you very much! You are my savior! You're welcome! "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...
likeabeast 53 Posted February 22, 2017 Share Posted February 22, 2017 18 minutes ago, Syreldar said: // ¸®ÅÏ°ª // 0: »õÀ̸§À» ¼³Á¤ÇÑ µÚ ·Î±×¾Æ¿ôÀ» ¾ÈÇßÀ½ // 1: ½ºÅ©¸³Æ®¿¡¼ ¹®ÀÚ¿ÀÌ ³Ñ¾î¿ÀÁö ¾Ê¾ÒÀ½ // 2: check_name À» Åë°úÇÏÁö ¸øÇßÀ½ // 3: ÀÌ¹Ì °°Àº À̸§ÀÌ »ç¿ëÁß // 4: ¼º°ø // 5: ÇØ´ç ±â´É Áö¿øÇÏÁö ¾ÊÀ½ if (!g_enable_pc_change_name) { lua_pushnumber(L, 5); return 1; } Search and delete this check. Eu am căutat treaba asta , doar că am aşa: int pc_change_name(lua_State* L) { // 리턴값 // 0: 새이름을 설정한 뒤 로그아웃을 안했음 // 1: 스크립트에서 문자열이 넘어오지 않았음 // 2: check_name 을 통과하지 못했음 // 3: 이미 같은 이름이 사용중 // 4: 성공 // 5: 해당 기능 지원하지 않음 if ( LC_IsEurope() ) { lua_pushnumber(L, 5); return 1; } LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if ( ch->GetNewName().size() != 0 ) { lua_pushnumber(L, 0); return 1; } if ( lua_isstring(L, 1) != true ) { lua_pushnumber(L, 1); return 1; } Şi tot nu îmi merge funcţia pc_change_name , ce ar trebui să fac? Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 1 minute ago, likeabeast said: Eu am căutat treaba asta , doar că am aşa: Şi tot nu îmi merge funcţia pc_change_name , ce ar trebui să fac? You will have to delete those both in order to make it work. if (!g_enable_pc_change_name) { lua_pushnumber(L, 5); return 1; } if ( LC_IsEurope() ) { lua_pushnumber(L, 5); return 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...
bloody 0 Posted February 22, 2017 Author Share Posted February 22, 2017 I deleted that thinks in know i don't receive that error now i recieve this say("Invalid name.[ENTER]") every time with every name.... Link to comment Share on other sites More sharing options...
Premium Syreldar 1882 Posted February 22, 2017 Premium Share Posted February 22, 2017 16 minutes ago, bloody said: I deleted that thinks in know i don't receive that error now i recieve this say("Invalid name.[ENTER]") every time with every name.... quest vip begin state start begin when 40003.use begin local item_vnum = item.get_vnum(); say_title(string.format("%s:[ENTER]", item_name(item_vnum))) if (string.find(pc.get_name(), "[VIP]") ~= nil) then return say("You already have a VIP name.[ENTER]"); end -- if local new_name = "[VIP]"..pc.get_name(); say("By continuing, you will be able to change") say("your character's name into a VIP name.[ENTER]") say_reward(string.format("Your new name will be: %s.[ENTER]", new_name)) say("Are you sure you want to continue?[ENTER]") if (select("Yes, I'm sure", "No, I'm not") == 1) then say_title(string.format("%s:[ENTER]", item_name(item_vnum))) local ret = pc.change_name(new_name); if (ret == 0) then say("An error occurred. (ret == 0).[ENTER]") elseif (ret == 1) then say("An error occurred. (ret == 1).[ENTER]") elseif (ret == 2) then say("Invalid name, please only use letters and numbers.[ENTER]") elseif (ret == 3) then say("That name is already being used") say("by another player.[ENTER]") elseif (ret == 4) then pc.remove_item(item_vnum, 1); say("The name has been successfully changed,") say("re-log to see the changes.[ENTER]") else say("The change_name function is blocked for") say("this locale.[ENTER]") end -- if/elseif/else end -- if end -- when end -- state end -- quest Try like this. "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...
bloody 0 Posted February 23, 2017 Author Share Posted February 23, 2017 same with this elseif (ret == 2) then say("Invalid name, please only use letters and numbers.[ENTER]") Link to comment Share on other sites More sharing options...
bloody 0 Posted February 23, 2017 Author Share Posted February 23, 2017 Ah and when i use item in this part of quest : say_reward(string.format("Your new name will be: %s.[ENTER]", new_name)) Appear just my name like bloody not [VIP]Bloody : local new_name = "[VIP]"..pc.get_name(); Probably here is problem becouse this quest try to change my name in my actual name and ret == 2 Link to comment Share on other sites More sharing options...
bloody 0 Posted February 24, 2017 Author Share Posted February 24, 2017 Problem resolved T/C. 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