Postado Outubro 14, 2014 10 anos Seria mais ou menos assim: Um point system que só o god poderá dar e que os jogadores poderiam sacar esses points e chegara em forma de um determinado item, pelo comando, "!sacar quantidade" Ou também poderia colocar esse item de volta pelo comando "!depositar quantidade", Como também visualizar a quantidade de points que ele tem "!saldo". O god poderá ver a quantidade de points que um determinado jogador tem pelo comando "!verpoints jogador" ou remover pelo comando "!removerpoints jogador". E com esses point também poderia fazer compras de itens virtual. OBS: Meu ot e 8.54, pokemon Darei Rep +. Por favor, ajudem.
Postado Outubro 15, 2014 10 anos Aqui está:va e Vai em seu banco de dados e execute essa querry: ALTER TABLE `accounts` ADD `premium_points` int(11) NOT NULL DEFAULT '0' depois vai em na sua lib e depois em 050-function.lua e coloque isso: function getPlayerPPoints(cid) local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") if Info:getID() ~= LUA_ERROR then local Points= Info:getDataInt("premium_points") Info:free() return Points end return LUA_ERROR end function AddPlayerPPontos(cid, points) local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") if Info:getID() ~= LUA_ERROR then db.executeQuery("UPDATE accounts SET premium_points = " .. getPlayerPPoints(cid) + points .. " WHERE id=" .. getPlayerAccountId(cid) .. ";") Info:free() return 1 end end function RemoverPlayerPPontos(cid, points) local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") if Info:getID() ~= LUA_ERROR then db.executeQuery("UPDATE accounts SET premium_points = " .. getPlayerPPoints(cid) - points .. " WHERE id=" .. getPlayerAccountId(cid) .. ";") Info:free() return 1 end end Feito isso, vai em talkaction/script cria um arquivo .lua e coloque isso: function onSay(cid, words, param) local t = string.explode(param, ",") local id = tonumber(t[1]) if words == "!depositar" then local id = tonumber(t[1]) if (id == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não é possível depositar 0 moedas!") return true end if (id == null) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Por favor digite um valor.") return true end if getPlayerItemCount(cid, 9971) >= id then AddPlayerPPontos(cid, id) doPlayerRemoveItem(cid, 9971, id) doPlayerSendTextMessage(cid, 29, "Parabéns, você depositou ".. id .." barras de ouro com sucesso! Seu saldo no banco agora é de ".. getPlayerPPoints(cid) .." moedas, para sacar utilize o comando !sacar") else doPlayerSendTextMessage(cid, 29, "Você não possui a quantidade necessária para adicionar no seu saldo.") return TRUE end ---------------------------------------------------------------------- elseif words == "!sacar" then local t = string.explode(param, ",") local id = tonumber(t[1]) if (id == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não é possível depositar 0 moedas!") return true end if (id == null) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Por favor digite um valor.") return true end if getPlayerPPoints(cid) >= id then doPlayerAddItem(cid, 9971, id) RemoverPlayerPPontos(cid, id) doPlayerSendTextMessage(cid, 29, "Parabéns, você sacou ".. id .." barras de ouro com sucesso! Seu saldo no banco agora é de ".. getPlayerPPoints(cid) .." moedas.") setPlayerStorageValue(cid,11548,os.time()+15) return TRUE else doPlayerSendTextMessage(cid, 29, "Você não possui a quantidade necessária para sacar.") end ------------------------------------------------------------------------ elseif words == "!saldo" then if not param or param == "" then doPlayerSendTextMessage(cid, 29, "O seu saldo no shopping é de: ".. getPlayerPPoints(cid) .." moedas.") return true end end ------------------------------------------------------------------------------------- elseif words == "!verpontos" then if (not t[1]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then local player = getPlayerGUIDByName(t[1]) if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else doPlayerSendTextMessage(cid, 29, "O jogador "..getCreatureName(t[1]) .." tem ".. getPlayerPPoints(t[1]).." moedas.") return true end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end ------------------------------------------------------------------------------------ elseif words == "!addpontos" then local player = getPlayerGUIDByName(t[1]) if (not t[1]) and (not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else AddPlayerPPontos(player,t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você adicionou "..t[2].." moedas para conta de "..t[1]..".") return true end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end ------------------------------------------------------------------------------------------------------------------------ elseif words == "!removerpontos" then local player = getPlayerGUIDByName(t[1]) if (not t[1]) and (not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else if(t[2] > getPlayerPPoints(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O jogador "..t[1].." só tem ".. getPlayerPPoints(player).." moedas.") return true end if(t[2] < 0) then RemoverPlayerPPontos(player,getPlayerPPoints(player)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Foi removida todos as moedas do jogador "..t[1]..".") else RemoverPlayerPPontos(player,t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Foi removido "..t[2].." moedas do jogador "..t[1]..".") return true end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end return TRUE end onde o numero 9971 é o item que será sacado do comando. agora vai em talkaction.xml <talkaction words="!saldo;!sacar;!depositar;!verpontos;!addpontos;!removerpontos" event="script" value="Nome do seu arquivo.lua"/> Como usar: !saldo -> retorna o valor do saldo !depositar qnt > deposita a qnt !sacar qnt -> saca a qnt !verpontos jogador -> ver o ponto do jogador !addpontos jogador,qnt -> add ao jogador a qnt de pontos !removerpontos jogador,qnt -> remove a qnt de pontos do jogador Espero ter ajudado. Te ajudei? Então Rep +
Postado Outubro 20, 2014 10 anos Autor Esta dando um erro aqui no script de um olhada [20/10/2014 12:54:24] >> Loading script systems [20/10/2014 12:54:25] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/dpoint.lua:54: 'end' expected (to close 'function' at line 1) near 'elseif' [20/10/2014 12:54:25] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/dpoint.lua) [20/10/2014 12:54:25] data/talkactions/scripts/dpoint.lua:54: 'end' expected (to close 'function' at line 1) near 'elseif'
Postado Outubro 20, 2014 10 anos tente agora: function onSay(cid, words, param) local t = string.explode(param, ",") local id = tonumber(t[1]) if words == "!depositar" then local id = tonumber(t[1]) if (id == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não é possível depositar 0 moedas!") return true end if (id == null) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Por favor digite um valor.") return true end if getPlayerItemCount(cid, 9971) >= id then AddPlayerPPontos(cid, id) doPlayerRemoveItem(cid, 9971, id) doPlayerSendTextMessage(cid, 29, "Parabéns, você depositou ".. id .." barras de ouro com sucesso! Seu saldo no banco agora é de ".. getPlayerPPoints(cid) .." moedas, para sacar utilize o comando !sacar") else doPlayerSendTextMessage(cid, 29, "Você não possui a quantidade necessária para adicionar no seu saldo.") return TRUE end ---------------------------------------------------------------------- elseif words == "!sacar" then local t = string.explode(param, ",") local id = tonumber(t[1]) if (id == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não é possível depositar 0 moedas!") return true end if (id == null) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Por favor digite um valor.") return true end if getPlayerPPoints(cid) >= id then doPlayerAddItem(cid, 9971, id) RemoverPlayerPPontos(cid, id) doPlayerSendTextMessage(cid, 29, "Parabéns, você sacou ".. id .." barras de ouro com sucesso! Seu saldo no banco agora é de ".. getPlayerPPoints(cid) .." moedas.") setPlayerStorageValue(cid,11548,os.time()+15) return TRUE else doPlayerSendTextMessage(cid, 29, "Você não possui a quantidade necessária para sacar.") end ------------------------------------------------------------------------ elseif words == "!saldo" then if not param or param == "" then doPlayerSendTextMessage(cid, 29, "O seu saldo no shopping é de: ".. getPlayerPPoints(cid) .." moedas.") return true end ------------------------------------------------------------------------------------- elseif words == "!verpontos" then if (not t[1]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then local player = getPlayerGUIDByName(t[1]) if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else doPlayerSendTextMessage(cid, 29, "O jogador "..getCreatureName(t[1]) .." tem ".. getPlayerPPoints(t[1]).." moedas.") return true end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end ------------------------------------------------------------------------------------ elseif words == "!addpontos" then local player = getPlayerGUIDByName(t[1]) if (not t[1]) and (not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else AddPlayerPPontos(player,t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você adicionou "..t[2].." moedas para conta de "..t[1]..".") return true end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end ------------------------------------------------------------------------------------------------------------------------ elseif words == "!removerpontos" then local player = getPlayerGUIDByName(t[1]) if (not t[1]) and (not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros") return true end if(getPlayerGroupId(cid) >= 3) then if (not player) then doPlayerSendTextMessage(cid, 29, "Jogador não existe ou não está online") return true else if(t[2] > getPlayerPPoints(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O jogador "..t[1].." só tem ".. getPlayerPPoints(player).." moedas.") return true end if(t[2] < 0) then RemoverPlayerPPontos(player,getPlayerPPoints(player)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Foi removida todos as moedas do jogador "..t[1]..".") else RemoverPlayerPPontos(player,t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Foi removido "..t[2].." moedas do jogador "..t[1]..".") return true end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem permição de usar esse comando") return true end return TRUE end end Te ajudei? Então Rep +
Postado Outubro 23, 2014 10 anos tem esse script para npc Se Ajudei Clique no ao Lado, Não Custa nada !! e se resovel o problema não esqueça de em ____________________________________________________________________________________________________ Formação de Equipe para poketibia venha fazer parte dessa equipe [bAIXEM] Sprites de icones para poketibia
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.