Postado Janeiro 31, 2015 10 anos Preciso de algums npcs para colocar no meu server os que eu achei deram erro então vim pedir aqui Vou Listar a Seguir os Npcs : 1º Npc change sex Resolvido 2º Npc Change Namer Npc que troca o nome do jogador por certa quantia configuravel UP Ajuda ae amigos Porfavor preciso muito deles Editado Fevereiro 8, 2015 10 anos por Zet0N0Murmurou (veja o histórico de edições) Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Postado Janeiro 31, 2015 10 anos O título do seu tópico estava inadequado. Sem oferecer nenhuma ideia do que ele se trata, poucos vão se interessar em te ajudar. Da próxima vez, crie um tópico com um título que descreva o assunto dele. - Conteúdo das Regras Gerais do fórum: • 2.3 - Use títulos e ícones adequados: Ao criar um novo tópico no fórum, dê a ele um título que esteja relacionado ao conteúdo do tópico. Títulos como "Ajudaaa!" ou "Entrem aqui!" só pioram as coisas: ninguém vai saber do que se trata, e menos pessoas irão entrar para olhar o que você postou e também evite de usar o CAPSLOCK ao criar seu título. The corrupt fear us. The honest support us. The heroic join us.
Postado Janeiro 31, 2015 10 anos Autor Ok, Desculpa ae Aproveitando aqui @UP Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Postado Janeiro 31, 2015 10 anos 1º pedido: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local price = xxx --Preço para trocar de sexo. if msgcontains(msg:lower(), "change") or msgcontains(msg:lower(), "sex") then selfSay("Do you wanna change your sex? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if doPlayerRemoveMoney(cid, price) then doPlayerSetSex(cid, getPlayerSex(cid) == 0 and 1 or 0) selfSay("You sucefully changed your sex.", cid) talkState[talkUser] = 0 return true else selfSay("You do not have enough gold.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2º pedido: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local price = xxx --Preço para trocar o nome. local characters = {} --Configure nesta tabela os caracteres (ou palavras) proibidos. local delay = 5 --Tempo para o jogador ser desconectado após trocar o nome. if msgcontains(msg:lower(), "name") or msgcontains(msg:lower(), "change") then selfSay("Do you wanna change your name? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if getPlayerMoney(cid) >= price then selfSay("OK, tell me your new name.", cid) talkState[talkUser] = 2 return true else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif talkState[talkUser] == 2 then local query = db.getResult("SELECT name FROM players") if query:getID() == -1 then selfSay("Database inexistent.", cid) talkState[talkUser] = 0 return true end repeat local name = query:getDataString("name") if msg == name then selfSay("This name is already in use.", cid) talkState[talkUser] = 0 return true end until not query:next() query:free() for i = 1, #characters do if msg:find(characters[i]) then selfSay("Sorry, this name isn't available.", cid) talkState[talkUser] = 0 return true end end db.executeQuery("UPDATE players SET name = '"..msg.."' WHERE id = "..getPlayerGUID(cid)) doPlayerRemoveMoney(cid, price) selfSay("You changed your name to {"..msg.."}. In "..delay.." second"..(delay > 1 and "s" or "")..", you will be disconected.", cid) addEvent(function() if isPlayer(cid) then doRemoveCreature(cid) end end, delay * 1000) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Fevereiro 6, 2015 10 anos por zipter98 (veja o histórico de edições) não respondo pms solicitando suporte em programação/scripting
Postado Fevereiro 1, 2015 10 anos Autor 1º pedido: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local price = xxx --Preço para trocar de sexo. if msgcontains(msg:lower(), "change") or msgcontains(msg:lower(), "sex") then selfSay("Do you wanna change your sex? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if doPlayerRemoveMoney(cid, price) then doPlayerSetSex(cid, getPlayerSex(cid) == 0 and 1 or 0) selfSay("You sucefully changed your sex.", cid) talkState[talkUser] = 0 return true else selfSay("You do not have enough gold.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2º pedido: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local price = xxx --Preço para trocar o nome. local characters = {} --Configure nesta tabela os caracteres (ou palavras) proibidos. local delay = 5 --Tempo para o jogador ser desconectado após trocar o nome. if msgcontains(msg:lower(), "name") or msgcontains(msg:lower(), "change") then selfSay("Do you wanna change your name? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if getPlayerMoney(cid) >= price then selfSay("OK, tell me your new name.", cid) talkState[talkUser] = 2 return true else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif talkState[talkUser] == 2 then local query = db.getResult("SELECT name FROM players") if query:getID() == -1 then selfSay("Database inexistent.", cid) talkState[talkUser] = 0 return true end repeat local name = query:getDataString("name") if msg == name then selfSay("This name is already in use.", cid) talkState[talkUser] = 0 return true end until not query:next() query:free() for i = 1, #characters do if msg:find(characters[i]) then selfSay("Sorry, this name isn't available.", cid) talkState[talkUser] = 0 return true end end db.executeQuery("UPDATE players SET name = "..msg.." WHERE id = "..getPlayerGUID(cid)) doPlayerRemoveMoney(cid, price) selfSay("You changed your name to {"..msg.."}. In "..delay.." second"..(delay > 1 and "s" or "")..", you will be disconected.", cid) addEvent(function() if isPlayer(cid) then doRemoveCreature(cid) end end, delay * 1000) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Vou testar já garantiu seu Rep por tentar qual quer coisa coloco como melhor resposta Amigo deu Erro no de mudar o nome na database e o de mudar o sexo faz tudo menos mudar o sexo do player Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.