Postado Janeiro 19, 2015 10 anos Ola galera estou com um pequeno problema em meu servidor o mesmo está dando esses erros no distro quando o player usa a pokedex em algum pokemon. Erro: [16/01/2015 22:53:47] [Error - Action Interface] [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:onUse [16/01/2015 22:53:47] Description: [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:213: attempt to compare number with string [16/01/2015 22:53:47] stack traceback: [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:213: in function aqui esta o scrip da pokedex: function onUse(cid, item, fromPos, itemEx, toPos) function isSummon(sid) for i, pid in ipairs(getPlayersOnline()) do for c, cid in pairs(getCreatureSummons(pid)) do if (cid == sid) then return true end end end return false end local pokemon = itemEx.uid local pokemons = { {"Bulbasaur", 20, 1001}, {"Ivysaur", 40, 1002}, {"Venusaur", 75, 1003}, {"Charmander", 20, 1004}, {"Charmeleon", 40, 1005}, {"Charizard", 75, 1006}, {"Squirtle", 20, 1007}, {"Wartortle", 40, 1008}, {"Blastoise", 75, 1009}, {"Caterpie", 5, 1010}, {"Metapod", 10, 1011}, {"Butterfree", 30, 1012}, {"Weedle", 5, 1013}, {"Kakuna", 10, 1014}, {"Beedrill", 30, 1015}, {"Pidgey", 5, 1016}, {"Pidgeotto", 20, 1017}, {"Pidgeot", 65, 1018}, {"Rattata", 5, 1019}, {"Raticate", 25, 1020}, {"Spearow", 5, 1021}, {"Fearow", 50, 1022}, {"Ekans", 12, 1023}, {"Arbok", 30, 1024}, {"Pikachu", 20, 1025}, {"Raichu", 45, 1026}, {"Sandshrew", 18, 1027}, {"Sandslash", 55, 1028}, {"Nidoran Female", 10, 1029}, {"Nidorina", 25, 1030}, {"Nidoqueen", 65, 1031}, {"Nidoran Male", 10, 1032}, {"Nidorino", 25, 1033}, {"Nidoking", 65, 1034}, {"Clefairy", 10, 1035}, {"Clefable", 35, 1036}, {"Vulpix", 20, 1037}, {"Ninetales", 65, 1038}, {"Jigglypuff", 10, 1039}, {"Wigglytuff", 42, 1040}, {"Zubat", 10, 1041}, {"Golbat", 30, 1042}, {"Oddish", 5, 1043}, {"Gloom", 10, 1044}, {"Vileplume", 50, 1045}, {"Paras", 5, 1046}, {"Parasect", 50, 1047}, {"Venonat", 18, 1048}, {"Venomoth", 50, 1049}, {"Diglett", 5, 1050}, {"Dugtrio", 35, 1051}, {"Meowth", 12, 1052}, {"Persion", 25, 1053}, {"Psyduck", 12, 1054}, {"Golduck", 55, 1055}, {"Mankey", 10, 1056}, {"Primeape", 45, 1057}, {"Growlithe", 20, 1058}, {"Arcanine", 75, 1059}, {"Poliwag", 5, 1060}, {"Poliwhirl", 20, 1061}, {"Poliwrath", 65, 1062}, {"Abra", 15, 1063}, {"Kadabra", 45, 1064}, {"Alakazam", 75, 1065}, {"Machop", 18, 1066}, {"Machoke", 40, 1067}, {"Machamp", 65, 1068}, {"Bellsprout", 5, 1069}, {"Weepinbell", 27, 1070}, {"Victreebel", 50, 1071}, {"Tentacool", 12, 1072}, {"Tentacruel", 70, 1073}, {"Geodude", 12, 1074}, {"Graveler", 40, 1075}, {"Golem", 65, 1076}, {"Ponyta", 20, 1077}, {"Rapidash", 60, 1078}, {"Slowpoke", 12, 1079}, {"Slowbro", 45, 1080}, {"Magnemite", 15, 1081}, {"Magneton", 40, 1082}, {"Farfetchd", 40, 1083}, {"Doduo", 12, 1084}, {"Dodrio", 45, 1085}, {"Seel", 20, 1086}, {"Dewgong", 65, 1087}, {"Grimer", 12, 1088}, {"Muk", 30, 1089}, {"Shellder", 5, 1090}, {"Cloyster", 65, 1091}, {"Gastly", 18, 1092}, {"Haunter", 45, 1093}, {"Gengar", 80, 1094}, {"Onix", 50, 1095}, {"Drowzee", 22, 1096}, {"Hypno", 50, 1097}, {"Krabby", 5, 1098}, {"Kingler", 35, 1099}, {"Voltorb", 14, 1100}, {"Electrode", 38, 1101}, {"Exeggcute", 8, 1102}, {"Exeggutor", 48, 1103}, {"Cubone", 18, 1104}, {"Marowak", 45, 1105}, {"Hitmonlee", 55, 1106}, {"Hitmonchan", 55, 1107}, {"Lickitung", 45, 1108}, {"Koffing", 15, 1109}, {"Weezing", 30, 1110}, {"Rhyhorn", 35, 1111}, {"Rhydon", 55, 1112}, {"Chansey", 50, 1113}, {"Tangela", 20, 1114}, {"Kangaskhan", 60, 1115}, {"Horsea", 5, 1116}, {"Seadra", 45, 1117}, {"Goldeen", 10, 1118}, {"Seaking", 25, 1119}, {"Staryu", 15, 1120}, {"Starmie", 45, 1121}, {"Mr.mime", 60, 1122}, {"Scyther", 70, 1123}, {"Jynx", 65, 1124}, {"Electabuzz", 70, 1125}, {"Magmar", 70, 1126}, {"Pinsir", 42, 1127}, {"Tauros", 40, 1128}, {"Magikarp", 1, 1129}, {"Gyarados", 75, 1130}, {"Shiny Gyarados", 175, 167}, {"Lapras", 70, 1131}, {"Ditto", 40, 1132}, {"Eevee", 20, 1133}, {"Vaporeon", 55, 1134}, {"Jolteon", 55, 1135}, {"Flareon", 55, 1136}, {"Porygon", 45, 1137}, {"Omanyte", 20, 1138}, {"Omastar", 70, 1139}, {"Kabuto", 20, 1140}, {"Kabutops", 70, 1141}, {"Aerodactyl", 110, 1142}, {"Snorlax", 85, 1143}, {"Articuno", 110, 1144}, {"Zapdos", 110, 1145}, {"Moltres", 110, 1146}, {"Dratini", 10, 1147}, {"Dragonair", 70, 1148}, {"Dragonite", 110, 1149}, {"Mewtwo", 110, 1150}, {"Mew", 110, 1151}, } for _,n in pairs(pokemons) do if isSummon(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level " .. n[2] .. " to unlock this pokemon.") elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, (v), Dex:read("*all")) Dex:close() end elseif isMonster(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, v, Dex:read("*all")) Dex:close() end end end local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151} local unlock = {} if not isCreature(itemEx.uid) then return true end for i = 1, #store do if getPlayerStorageValue(itemEx.uid, store) > 0 then table.insert(unlock, 1) end end if isPlayer(itemEx.uid) then setPlayerStorageValue(cid, 7274, 1) if getCreatureName(cid) == getCreatureName(itemEx.uid) then doPlayerSendTextMessage(cid, 27, "You have unlocked " .. #unlock .. " pokemons already.") doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex \". Example: \"/dex Pikachu\".") else doPlayerSendTextMessage(cid, 27, getPlayerName(itemEx.uid) .. " has unlocked " .. #unlock .. " pokemons already.") end end return true end Espero poder contar com ajuda de vcs para colocar esse servidor on obrigado. Acho que assim funciona: function onUse(cid, item, fromPos, itemEx, toPos) function isSummon(sid) for i, pid in ipairs(getPlayersOnline()) do for c, cid in pairs(getCreatureSummons(pid)) do if (cid == sid) then return true end end end return false end local pokemon = itemEx.uid local pokemons = { {"Bulbasaur", 20, 1001}, {"Ivysaur", 40, 1002}, {"Venusaur", 75, 1003}, {"Charmander", 20, 1004}, {"Charmeleon", 40, 1005}, {"Charizard", 75, 1006}, {"Squirtle", 20, 1007}, {"Wartortle", 40, 1008}, {"Blastoise", 75, 1009}, {"Caterpie", 5, 1010}, {"Metapod", 10, 1011}, {"Butterfree", 30, 1012}, {"Weedle", 5, 1013}, {"Kakuna", 10, 1014}, {"Beedrill", 30, 1015}, {"Pidgey", 5, 1016}, {"Pidgeotto", 20, 1017}, {"Pidgeot", 65, 1018}, {"Rattata", 5, 1019}, {"Raticate", 25, 1020}, {"Spearow", 5, 1021}, {"Fearow", 50, 1022}, {"Ekans", 12, 1023}, {"Arbok", 30, 1024}, {"Pikachu", 20, 1025}, {"Raichu", 45, 1026}, {"Sandshrew", 18, 1027}, {"Sandslash", 55, 1028}, {"Nidoran Female", 10, 1029}, {"Nidorina", 25, 1030}, {"Nidoqueen", 65, 1031}, {"Nidoran Male", 10, 1032}, {"Nidorino", 25, 1033}, {"Nidoking", 65, 1034}, {"Clefairy", 10, 1035}, {"Clefable", 35, 1036}, {"Vulpix", 20, 1037}, {"Ninetales", 65, 1038}, {"Jigglypuff", 10, 1039}, {"Wigglytuff", 42, 1040}, {"Zubat", 10, 1041}, {"Golbat", 30, 1042}, {"Oddish", 5, 1043}, {"Gloom", 10, 1044}, {"Vileplume", 50, 1045}, {"Paras", 5, 1046}, {"Parasect", 50, 1047}, {"Venonat", 18, 1048}, {"Venomoth", 50, 1049}, {"Diglett", 5, 1050}, {"Dugtrio", 35, 1051}, {"Meowth", 12, 1052}, {"Persion", 25, 1053}, {"Psyduck", 12, 1054}, {"Golduck", 55, 1055}, {"Mankey", 10, 1056}, {"Primeape", 45, 1057}, {"Growlithe", 20, 1058}, {"Arcanine", 75, 1059}, {"Poliwag", 5, 1060}, {"Poliwhirl", 20, 1061}, {"Poliwrath", 65, 1062}, {"Abra", 15, 1063}, {"Kadabra", 45, 1064}, {"Alakazam", 75, 1065}, {"Machop", 18, 1066}, {"Machoke", 40, 1067}, {"Machamp", 65, 1068}, {"Bellsprout", 5, 1069}, {"Weepinbell", 27, 1070}, {"Victreebel", 50, 1071}, {"Tentacool", 12, 1072}, {"Tentacruel", 70, 1073}, {"Geodude", 12, 1074}, {"Graveler", 40, 1075}, {"Golem", 65, 1076}, {"Ponyta", 20, 1077}, {"Rapidash", 60, 1078}, {"Slowpoke", 12, 1079}, {"Slowbro", 45, 1080}, {"Magnemite", 15, 1081}, {"Magneton", 40, 1082}, {"Farfetchd", 40, 1083}, {"Doduo", 12, 1084}, {"Dodrio", 45, 1085}, {"Seel", 20, 1086}, {"Dewgong", 65, 1087}, {"Grimer", 12, 1088}, {"Muk", 30, 1089}, {"Shellder", 5, 1090}, {"Cloyster", 65, 1091}, {"Gastly", 18, 1092}, {"Haunter", 45, 1093}, {"Gengar", 80, 1094}, {"Onix", 50, 1095}, {"Drowzee", 22, 1096}, {"Hypno", 50, 1097}, {"Krabby", 5, 1098}, {"Kingler", 35, 1099}, {"Voltorb", 14, 1100}, {"Electrode", 38, 1101}, {"Exeggcute", 8, 1102}, {"Exeggutor", 48, 1103}, {"Cubone", 18, 1104}, {"Marowak", 45, 1105}, {"Hitmonlee", 55, 1106}, {"Hitmonchan", 55, 1107}, {"Lickitung", 45, 1108}, {"Koffing", 15, 1109}, {"Weezing", 30, 1110}, {"Rhyhorn", 35, 1111}, {"Rhydon", 55, 1112}, {"Chansey", 50, 1113}, {"Tangela", 20, 1114}, {"Kangaskhan", 60, 1115}, {"Horsea", 5, 1116}, {"Seadra", 45, 1117}, {"Goldeen", 10, 1118}, {"Seaking", 25, 1119}, {"Staryu", 15, 1120}, {"Starmie", 45, 1121}, {"Mr.mime", 60, 1122}, {"Scyther", 70, 1123}, {"Jynx", 65, 1124}, {"Electabuzz", 70, 1125}, {"Magmar", 70, 1126}, {"Pinsir", 42, 1127}, {"Tauros", 40, 1128}, {"Magikarp", 1, 1129}, {"Gyarados", 75, 1130}, {"Shiny Gyarados", 175, 167}, {"Lapras", 70, 1131}, {"Ditto", 40, 1132}, {"Eevee", 20, 1133}, {"Vaporeon", 55, 1134}, {"Jolteon", 55, 1135}, {"Flareon", 55, 1136}, {"Porygon", 45, 1137}, {"Omanyte", 20, 1138}, {"Omastar", 70, 1139}, {"Kabuto", 20, 1140}, {"Kabutops", 70, 1141}, {"Aerodactyl", 110, 1142}, {"Snorlax", 85, 1143}, {"Articuno", 110, 1144}, {"Zapdos", 110, 1145}, {"Moltres", 110, 1146}, {"Dratini", 10, 1147}, {"Dragonair", 70, 1148}, {"Dragonite", 110, 1149}, {"Mewtwo", 110, 1150}, {"Mew", 110, 1151}, } for _,n in pairs(pokemons) do if isSummon(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level " .. n[2] .. " to unlock this pokemon.") elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, (v), Dex:read("*all")) Dex:close() end elseif isMonster(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, v, Dex:read("*all")) Dex:close() end end end local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151} local unlock = {} if not isCreature(itemEx.uid) then return true end for i = 1, #store do if getPlayerStorageValue(itemEx.uid, tonumber(store[i])) > 0 then table.insert(unlock, 1) end end if isPlayer(itemEx.uid) then setPlayerStorageValue(cid, 7274, 1) if getCreatureName(cid) == getCreatureName(itemEx.uid) then doPlayerSendTextMessage(cid, 27, "You have unlocked " .. #unlock .. " pokemons already.") doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex \". Example: \"/dex Pikachu\".") else doPlayerSendTextMessage(cid, 27, getPlayerName(itemEx.uid) .. " has unlocked " .. #unlock .. " pokemons already.") end end return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Janeiro 19, 2015 10 anos Ola galera estou com um pequeno problema em meu servidor o mesmo está dando esses erros no distro quando o player usa a pokedex em algum pokemon. Erro: [16/01/2015 22:53:47] [Error - Action Interface] [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:onUse [16/01/2015 22:53:47] Description: [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:213: attempt to compare number with string [16/01/2015 22:53:47] stack traceback: [16/01/2015 22:53:47] data/actions/scripts/pokemon/pokedex.lua:213: in function aqui esta o scrip da pokedex: function onUse(cid, item, fromPos, itemEx, toPos) function isSummon(sid) for i, pid in ipairs(getPlayersOnline()) do for c, cid in pairs(getCreatureSummons(pid)) do if (cid == sid) then return true end end end return false end local pokemon = itemEx.uid local pokemons = { {"Bulbasaur", 20, 1001}, {"Ivysaur", 40, 1002}, {"Venusaur", 75, 1003}, {"Charmander", 20, 1004}, {"Charmeleon", 40, 1005}, {"Charizard", 75, 1006}, {"Squirtle", 20, 1007}, {"Wartortle", 40, 1008}, {"Blastoise", 75, 1009}, {"Caterpie", 5, 1010}, {"Metapod", 10, 1011}, {"Butterfree", 30, 1012}, {"Weedle", 5, 1013}, {"Kakuna", 10, 1014}, {"Beedrill", 30, 1015}, {"Pidgey", 5, 1016}, {"Pidgeotto", 20, 1017}, {"Pidgeot", 65, 1018}, {"Rattata", 5, 1019}, {"Raticate", 25, 1020}, {"Spearow", 5, 1021}, {"Fearow", 50, 1022}, {"Ekans", 12, 1023}, {"Arbok", 30, 1024}, {"Pikachu", 20, 1025}, {"Raichu", 45, 1026}, {"Sandshrew", 18, 1027}, {"Sandslash", 55, 1028}, {"Nidoran Female", 10, 1029}, {"Nidorina", 25, 1030}, {"Nidoqueen", 65, 1031}, {"Nidoran Male", 10, 1032}, {"Nidorino", 25, 1033}, {"Nidoking", 65, 1034}, {"Clefairy", 10, 1035}, {"Clefable", 35, 1036}, {"Vulpix", 20, 1037}, {"Ninetales", 65, 1038}, {"Jigglypuff", 10, 1039}, {"Wigglytuff", 42, 1040}, {"Zubat", 10, 1041}, {"Golbat", 30, 1042}, {"Oddish", 5, 1043}, {"Gloom", 10, 1044}, {"Vileplume", 50, 1045}, {"Paras", 5, 1046}, {"Parasect", 50, 1047}, {"Venonat", 18, 1048}, {"Venomoth", 50, 1049}, {"Diglett", 5, 1050}, {"Dugtrio", 35, 1051}, {"Meowth", 12, 1052}, {"Persion", 25, 1053}, {"Psyduck", 12, 1054}, {"Golduck", 55, 1055}, {"Mankey", 10, 1056}, {"Primeape", 45, 1057}, {"Growlithe", 20, 1058}, {"Arcanine", 75, 1059}, {"Poliwag", 5, 1060}, {"Poliwhirl", 20, 1061}, {"Poliwrath", 65, 1062}, {"Abra", 15, 1063}, {"Kadabra", 45, 1064}, {"Alakazam", 75, 1065}, {"Machop", 18, 1066}, {"Machoke", 40, 1067}, {"Machamp", 65, 1068}, {"Bellsprout", 5, 1069}, {"Weepinbell", 27, 1070}, {"Victreebel", 50, 1071}, {"Tentacool", 12, 1072}, {"Tentacruel", 70, 1073}, {"Geodude", 12, 1074}, {"Graveler", 40, 1075}, {"Golem", 65, 1076}, {"Ponyta", 20, 1077}, {"Rapidash", 60, 1078}, {"Slowpoke", 12, 1079}, {"Slowbro", 45, 1080}, {"Magnemite", 15, 1081}, {"Magneton", 40, 1082}, {"Farfetchd", 40, 1083}, {"Doduo", 12, 1084}, {"Dodrio", 45, 1085}, {"Seel", 20, 1086}, {"Dewgong", 65, 1087}, {"Grimer", 12, 1088}, {"Muk", 30, 1089}, {"Shellder", 5, 1090}, {"Cloyster", 65, 1091}, {"Gastly", 18, 1092}, {"Haunter", 45, 1093}, {"Gengar", 80, 1094}, {"Onix", 50, 1095}, {"Drowzee", 22, 1096}, {"Hypno", 50, 1097}, {"Krabby", 5, 1098}, {"Kingler", 35, 1099}, {"Voltorb", 14, 1100}, {"Electrode", 38, 1101}, {"Exeggcute", 8, 1102}, {"Exeggutor", 48, 1103}, {"Cubone", 18, 1104}, {"Marowak", 45, 1105}, {"Hitmonlee", 55, 1106}, {"Hitmonchan", 55, 1107}, {"Lickitung", 45, 1108}, {"Koffing", 15, 1109}, {"Weezing", 30, 1110}, {"Rhyhorn", 35, 1111}, {"Rhydon", 55, 1112}, {"Chansey", 50, 1113}, {"Tangela", 20, 1114}, {"Kangaskhan", 60, 1115}, {"Horsea", 5, 1116}, {"Seadra", 45, 1117}, {"Goldeen", 10, 1118}, {"Seaking", 25, 1119}, {"Staryu", 15, 1120}, {"Starmie", 45, 1121}, {"Mr.mime", 60, 1122}, {"Scyther", 70, 1123}, {"Jynx", 65, 1124}, {"Electabuzz", 70, 1125}, {"Magmar", 70, 1126}, {"Pinsir", 42, 1127}, {"Tauros", 40, 1128}, {"Magikarp", 1, 1129}, {"Gyarados", 75, 1130}, {"Shiny Gyarados", 175, 167}, {"Lapras", 70, 1131}, {"Ditto", 40, 1132}, {"Eevee", 20, 1133}, {"Vaporeon", 55, 1134}, {"Jolteon", 55, 1135}, {"Flareon", 55, 1136}, {"Porygon", 45, 1137}, {"Omanyte", 20, 1138}, {"Omastar", 70, 1139}, {"Kabuto", 20, 1140}, {"Kabutops", 70, 1141}, {"Aerodactyl", 110, 1142}, {"Snorlax", 85, 1143}, {"Articuno", 110, 1144}, {"Zapdos", 110, 1145}, {"Moltres", 110, 1146}, {"Dratini", 10, 1147}, {"Dragonair", 70, 1148}, {"Dragonite", 110, 1149}, {"Mewtwo", 110, 1150}, {"Mew", 110, 1151}, } for _,n in pairs(pokemons) do if isSummon(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[2] and getPlayerStorageValue(cid, n[3]) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level " .. n[2] .. " to unlock this pokemon.") elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, (v), Dex:read("*all")) Dex:close() end elseif isMonster(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) <= 0 then j = (n[2]) *10 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, (n[2])*10) setPlayerStorageValue(cid, n[3], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 then local v = ((n[3]) + 1376) local dexstring = ""..n[1]..".txt" local Dex = io.open('data/pokedex/'..dexstring, 'r') doShowTextDialog(cid, v, Dex:read("*all")) Dex:close() end end end local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151} local unlock = {} if not isCreature(itemEx.uid) then return true end for i = 1, #store do if getPlayerStorageValue(itemEx.uid, store) > 0 then table.insert(unlock, 1) end end if isPlayer(itemEx.uid) then setPlayerStorageValue(cid, 7274, 1) if getCreatureName(cid) == getCreatureName(itemEx.uid) then doPlayerSendTextMessage(cid, 27, "You have unlocked " .. #unlock .. " pokemons already.") doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex \". Example: \"/dex Pikachu\".") else doPlayerSendTextMessage(cid, 27, getPlayerName(itemEx.uid) .. " has unlocked " .. #unlock .. " pokemons already.") end end return true end Espero poder contar com ajuda de vcs para colocar esse servidor on obrigado. Eae Lessa1994 blz? como eu avia dito antes tava com 1 poblema parecido com o seu e eu achei 1 tutorial e conseguir resolver e o seguinte: va a pasta: \data\lib\pokedex system.lua Você coloca isso tudo lah: local skills = specialabilities --alterado v2.9 \/ TUDO!! function doAddPokemonInDexList(cid, poke) if getPlayerInfoAboutPokemon(cid, poke).dex then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." dex,") end function getPokemonEvolutionDescription(name, next) local kev = poevo[name] local stt = {} if isInArray(specialevo, name) then if name == "Poliwhirl" then if next then return "\nPoliwrath or Politoed, requires level 65." end table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and King's Rock\n\n") table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.") elseif name == "Gloom" then if next then return "\nVileplume or Bellossom, requires level 50." end table.insert(stt, "Evolve Stone: Leaf Stone and Venom Stone or Leaf Stone and Sun Stone\n\n") table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.") elseif name == "Slowpoke" then if next then return "\nSlowbro, requires level 45.\nSlowking, requires level 100." end table.insert(stt, "Evolve Stone: Enigma Stone or King's Rock\n\n") table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.") elseif name == "Eevee" then if next then return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55." end table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n") table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.") elseif name == "Tyrogue" then if next then return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60." end table.insert(stt, "Evolve Stone: Punch Stone\n\n") table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.") end elseif kev then if next then table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".") return table.concat(stt) end local id = tonumber(kev.stoneid) local id2 = tonumber(kev.stoneid2) local stone = "" if tonumber(kev.count) == 2 then stone = doConvertStoneIdToString(id).." (2x)" else stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2) end table.insert(stt, "Evolve Stone: "..stone.."\n\n") table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".") table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true)) else if not next then table.insert(stt, "Evolutions:\nIt doen't evolve." ) end end return table.concat(stt) end local function getMoveDexDescr(cid, name, number) local x = movestable[name] if not x then return "" end local z = "\n" local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12} local y = tables[number] if not y then return "" end if getTableMove(cid, y.name) == "" then print(""..y.name.." faltando") return "unknown error" end local txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) return txt end --alterado v2.8 local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"} local passivas = { ["Electricity"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", tpw = "electric"}, ["Lava Counter"] = {"Magmar", "Magby", tpw = "fire"}, ["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"}, ["Giroball"] = {"Pineco", "Forretress", tpw = "steel"}, ["Counter Claw"] = {"Scizor", tpw = "bug"}, ["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"}, ["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"}, ["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"}, --alterado v2.6 ["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"}, ["Groundshock"] = {"Kangaskhan", tpw = "normal"}, ["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"}, ["Melody"] = {"Wigglytuff", tpw = "normal"}, ["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"}, ["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"}, ["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"}, ["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"}, ["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"}, ["Zen Mind"] = {"Slowking", tpw = "psychic"}, ["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"}, ["Lifesteal"] = {"Crobat", tpw = "normal"}, ["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"}, ["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"}, ["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"}, } function doShowPokedexRegistration(cid, pokemon, ball) local item2 = pokemon local virtual = false if type(pokemon) == "string" then virtual = true end local myball = ball local name = virtual and pokemon or getCreatureName(item2.uid) local v = fotos[name] local stt = {} table.insert(stt, "Name: "..name.."\n") if pokes[name].type2 and pokes[name].type2 ~= "no type" then table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2.."") else table.insert(stt, "Type: "..pokes[name].type.."") end if virtual then table.insert(stt, "\nLevel Base: "..pokes[name].level.."\n") else table.insert(stt, "\nRequired level: "..getPokemonLevel(item2.uid).."\n") end if showStatusInDex then if virtual then table.insert(stt, "\nStatus:\n") local status = getPokemonStatus(name, pokes[name].level) table.insert(stt, "•Offense: "..status.offense.."\n•Defense: "..status.defense.."\n•Agility: "..status.agility.."\n•Sp. Attack: "..status.specialattack.."\n•Vitality: "..status.vitality.."\n") else table.insert(stt, "\nStatus:\n") local status = getPokemonStatus(name, getPokemonLevel(item2.uid) + getPokemonBoost(item2.uid)) table.insert(stt, "•Offense: "..status.offense.."\n•Defense: "..status.defense.."\n•Agility: "..status.agility.."\n•Sp. Attack: "..status.specialattack.."\n•Vitality: "..status.vitality.."\n") end end table.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n") table.insert(stt, "\nMoves:") if name == "Ditto" then if virtual then table.insert(stt, "\nIt doesn't use any moves until transformed.") elseif getPlayerStorageValue(item2.uid, 1010) == "Ditto" or getPlayerStorageValue(item2.uid, 1010) == -1 then table.insert(stt, "\nIt doesn't use any moves until transformed.") else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, getPlayerStorageValue(item2.uid, 1010), a).."") end end else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, name, a).."") end end for e, f in pairs(passivas) do if isInArray(passivas[e], name) then local tpw = passivas[e].tpw if name == "Pineco" and passivas[e] == "Giroball" then tpw = "bug" end table.insert(stt, "\n"..e.." - passive - "..tpw.."") end end table.insert(stt, "\n\nAbility:\n") local abilityNONE = true for b, c in pairs(skills) do if isInArray(skillcheck, b) then if isInArray(c, name) then table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n") abilityNONE = false end end end if abilityNONE then table.insert(stt, "None") end if string.len(table.concat(stt)) > 8192 then print("Erro ao fazer Informação pokedex com pokemon chamado "..name..".\n Registro de Pokedex tem mais de 8192 letras (it has "..string.len(stt).." letras), foi bloqueada para evitar erro fatal.") doPlayerSendCancel(cid, "Ocorreu um erro, ele foi enviado para o administrador do servidor.") return true end doShowTextDialog(cid, v, table.concat(stt)) end salve e feche. depois vai na pasta:data\actions\scripts\pokedex.lua e cola isso tudo lah: local rate = 20 function onUse(cid, item, fromPos, item2, toPos) if not isCreature(item2.uid) then return true end local poke = getCreatureName(item2.uid) if isMonster(item2.uid) then local this = newpokedex[getCreatureName(item2.uid)] local leveltable = getPokemonExperienceTable(getCreatureName(item2.uid)) local myball = 0 if isSummon(item2.uid) then myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8) end if not getPlayerInfoAboutPokemon(cid, poke).dex then local exp = this.level * rate doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou"..getCreatureName(item2.uid).." em sua pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ganhou "..exp.." pontos de experiência.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, exp) doAddPokemonInDexList(cid, poke) else doShowPokedexRegistration(cid, item2, myball, leveltable) end return true end if not isPlayer(item2.uid) then return true end --alterado v2.7 \/\/ local kanto = 0 local johto = 0 for i = 1, #oldpokedex do if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[1]).dex then if i <= 151 then kanto = kanto+1 elseif i >= 209 then johto = johto+1 end end end local player = getRecorderPlayer(toPos, cid) if cid == player then doPlayerSendTextMessage(cid, 27, "Você desbloqueou "..kanto.." kanto's e "..johto.." johto's pokémons até agora.") doPlayerSetVocation(cid, 9) openChannelDialog(cid) end return true end salve e fecha. agora vai na pasta :\data\lib\some functions.lua e localiza isso "function getRecorderPlayer" cola isso no lugar : function getRecorderPlayer(pos, cid) local ret = 0 if cid and getThingPos(cid).x == pos.x and getThingPos(cid).y == pos.y then return cid end local s = {} s.x = pos.x s.y = pos.y s.z = pos.z for a = 0, 255 do s.stackpos = a local b = getTileThingByPos(s).uid if b > 1 and isPlayer(b) and getCreatureOutfit(b).lookType ~= 814 then ret = b end end return ret end salve e fecha. a Pokedex deve ficar assim. Credito: Kibbutz: por ter disponibilizado esse tutorial
Postado Janeiro 19, 2015 10 anos Autor Servidor usado? Servidor Dash Versão 9 Eae Lessa1994 blz? como eu avia dito antes tava com 1 poblema parecido com o seu e eu achei 1 tutorial e conseguir resolver e o seguinte: va a pasta: \data\lib\pokedex system.lua Você coloca isso tudo lah: local skills = specialabilities --alterado v2.9 \/ TUDO!! function doAddPokemonInDexList(cid, poke) if getPlayerInfoAboutPokemon(cid, poke).dex then return true end local a = newpokedex[poke] local b = getPlayerStorageValue(cid, a.storage) setPlayerStorageValue(cid, a.storage, b.." dex,") end function getPokemonEvolutionDescription(name, next) local kev = poevo[name] local stt = {} if isInArray(specialevo, name) then if name == "Poliwhirl" then if next then return "\nPoliwrath or Politoed, requires level 65." end table.insert(stt, "Evolve Stone: Water Stone and Punch Stone or Water Stone and King's Rock\n\n") table.insert(stt, "Evolutions:\nPoliwrath, requires level 65.\nPolitoed, requires level 65.") elseif name == "Gloom" then if next then return "\nVileplume or Bellossom, requires level 50." end table.insert(stt, "Evolve Stone: Leaf Stone and Venom Stone or Leaf Stone and Sun Stone\n\n") table.insert(stt, "Evolutions:\nVileplume, requires level 50.\nBellossom, requires level 50.") elseif name == "Slowpoke" then if next then return "\nSlowbro, requires level 45.\nSlowking, requires level 100." end table.insert(stt, "Evolve Stone: Enigma Stone or King's Rock\n\n") table.insert(stt, "Evolutions:\nSlowbro, requires level 45.\nSlowking, requires level 100.") elseif name == "Eevee" then if next then return "\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55." end table.insert(stt, "Evolve Stone: Water Stone or Thunder Stone or Fire Stone or Darkness Stone or Enigma Stone\n\n") table.insert(stt, "Evolutions:\nVaporeon, requires level 55.\nJolteon, requires level 55.\nFlareon, requires level 55.\nUmbreon, requires level 55.\nEspeon, requires level 55.") elseif name == "Tyrogue" then if next then return "\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60." end table.insert(stt, "Evolve Stone: Punch Stone\n\n") table.insert(stt, "Evolutions:\nHitmonlee, requires level 60.\nHitmonchan, requires level 60.\nHitmontop, requires level 60.") end elseif kev then if next then table.insert(stt, "\n"..kev.evolution..", requires level "..kev.level..".") return table.concat(stt) end local id = tonumber(kev.stoneid) local id2 = tonumber(kev.stoneid2) local stone = "" if tonumber(kev.count) == 2 then stone = doConvertStoneIdToString(id).." (2x)" else stone = id2 == 0 and doConvertStoneIdToString(id) or doConvertStoneIdToString(id).." and "..doConvertStoneIdToString(id2) end table.insert(stt, "Evolve Stone: "..stone.."\n\n") table.insert(stt, "Evolutions:\n"..kev.evolution..", requeris level "..kev.level..".") table.insert(stt, getPokemonEvolutionDescription(kev.evolution, true)) else if not next then table.insert(stt, "Evolutions:\nIt doen't evolve." ) end end return table.concat(stt) end local function getMoveDexDescr(cid, name, number) local x = movestable[name] if not x then return "" end local z = "\n" local tables = {x.move1, x.move2, x.move3, x.move4, x.move5, x.move6, x.move7, x.move8, x.move9, x.move10, x.move11, x.move12} local y = tables[number] if not y then return "" end if getTableMove(cid, y.name) == "" then print(""..y.name.." faltando") return "unknown error" end local txt = ""..z..""..y.name.." - m"..number.." - level "..y.level.." - "..(y.t) return txt end --alterado v2.8 local skillcheck = {"fly", "ride", "surf", "teleport", "rock smash", "cut", "dig", "light", "blink", "control mind", "transform", "levitate_fly"} local passivas = { ["Electricity"] = {"Electabuzz", "Shiny Electabuzz", "Elekid", tpw = "electric"}, ["Lava Counter"] = {"Magmar", "Magby", tpw = "fire"}, ["Counter Helix"] = {"Scyther", "Shiny Scyther", tpw = "bug"}, ["Giroball"] = {"Pineco", "Forretress", tpw = "steel"}, ["Counter Claw"] = {"Scizor", tpw = "bug"}, ["Counter Spin"] = {"Hitmontop", "Shiny Hitmontop", tpw = "fighting"}, ["Demon Kicker"] = {"Hitmonlee", "Shiny Hitmonlee", tpw = "fighting"}, ["Demon Puncher"] = {"Hitmonchan", "Shiny Hitmonchan", tpw = "unknow"}, --alterado v2.6 ["Stunning Confusion"] = {"Psyduck", "Golduck", "Wobbuffet", tpw = "psychic"}, ["Groundshock"] = {"Kangaskhan", tpw = "normal"}, ["Electric Charge"] = {"Pikachu", "Raichu", "Shiny Raichu", tpw = "electric"}, ["Melody"] = {"Wigglytuff", tpw = "normal"}, ["Dragon Fury"] = {"Dratini", "Dragonair", "Dragonite", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", tpw = "dragon"}, ["Fury"] = {"Persian", "Raticate", "Shiny Raticate", tpw = "normal"}, ["Mega Drain"] = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela", tpw = "grass"}, ["Spores Reaction"] = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume", tpw = "grass"}, ["Amnesia"] = {"Wooper", "Quagsire", "Swinub", "Piloswine", tpw = "psychic"}, ["Zen Mind"] = {"Slowking", tpw = "psychic"}, ["Mirror Coat"] = {"Wobbuffet", tpw = "psychic"}, ["Lifesteal"] = {"Crobat", tpw = "normal"}, ["Evasion"] = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Ledian", "Ledyba", "Sneasel", tpw = "normal"}, ["Foresight"] = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Hitmontop", "Hitmontop", "Hitmonlee", "Hitmonchan", tpw = "fighting"}, ["Levitate"] = {"Gengar", "Haunter", "Gastly", "Misdreavus", "Weezing", "Koffing", "Unown", "Shiny Gengar", tpw = "ghost"}, } function doShowPokedexRegistration(cid, pokemon, ball) local item2 = pokemon local virtual = false if type(pokemon) == "string" then virtual = true end local myball = ball local name = virtual and pokemon or getCreatureName(item2.uid) local v = fotos[name] local stt = {} table.insert(stt, "Name: "..name.."\n") if pokes[name].type2 and pokes[name].type2 ~= "no type" then table.insert(stt, "Type: "..pokes[name].type.."/"..pokes[name].type2.."") else table.insert(stt, "Type: "..pokes[name].type.."") end if virtual then table.insert(stt, "\nLevel Base: "..pokes[name].level.."\n") else table.insert(stt, "\nRequired level: "..getPokemonLevel(item2.uid).."\n") end if showStatusInDex then if virtual then table.insert(stt, "\nStatus:\n") local status = getPokemonStatus(name, pokes[name].level) table.insert(stt, "•Offense: "..status.offense.."\n•Defense: "..status.defense.."\n•Agility: "..status.agility.."\n•Sp. Attack: "..status.specialattack.."\n•Vitality: "..status.vitality.."\n") else table.insert(stt, "\nStatus:\n") local status = getPokemonStatus(name, getPokemonLevel(item2.uid) + getPokemonBoost(item2.uid)) table.insert(stt, "•Offense: "..status.offense.."\n•Defense: "..status.defense.."\n•Agility: "..status.agility.."\n•Sp. Attack: "..status.specialattack.."\n•Vitality: "..status.vitality.."\n") end end table.insert(stt, "\n"..getPokemonEvolutionDescription(name).."\n") table.insert(stt, "\nMoves:") if name == "Ditto" then if virtual then table.insert(stt, "\nIt doesn't use any moves until transformed.") elseif getPlayerStorageValue(item2.uid, 1010) == "Ditto" or getPlayerStorageValue(item2.uid, 1010) == -1 then table.insert(stt, "\nIt doesn't use any moves until transformed.") else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, getPlayerStorageValue(item2.uid, 1010), a).."") end end else for a = 1, 15 do table.insert(stt, getMoveDexDescr(item2.uid, name, a).."") end end for e, f in pairs(passivas) do if isInArray(passivas[e], name) then local tpw = passivas[e].tpw if name == "Pineco" and passivas[e] == "Giroball" then tpw = "bug" end table.insert(stt, "\n"..e.." - passive - "..tpw.."") end end table.insert(stt, "\n\nAbility:\n") local abilityNONE = true for b, c in pairs(skills) do if isInArray(skillcheck, b) then if isInArray(c, name) then table.insert(stt, (b == "levitate_fly" and "Levitate" or doCorrectString(b)).."\n") abilityNONE = false end end end if abilityNONE then table.insert(stt, "None") end if string.len(table.concat(stt)) > 8192 then print("Erro ao fazer Informação pokedex com pokemon chamado "..name..".\n Registro de Pokedex tem mais de 8192 letras (it has "..string.len(stt).." letras), foi bloqueada para evitar erro fatal.") doPlayerSendCancel(cid, "Ocorreu um erro, ele foi enviado para o administrador do servidor.") return true end doShowTextDialog(cid, v, table.concat(stt)) end salve e feche. depois vai na pasta:data\actions\scripts\pokedex.lua e cola isso tudo lah: local rate = 20 function onUse(cid, item, fromPos, item2, toPos) if not isCreature(item2.uid) then return true end local poke = getCreatureName(item2.uid) if isMonster(item2.uid) then local this = newpokedex[getCreatureName(item2.uid)] local leveltable = getPokemonExperienceTable(getCreatureName(item2.uid)) local myball = 0 if isSummon(item2.uid) then myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8) end if not getPlayerInfoAboutPokemon(cid, poke).dex then local exp = this.level * rate doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou"..getCreatureName(item2.uid).." em sua pokedex!") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ganhou "..exp.." pontos de experiência.") doSendMagicEffect(getThingPos(cid), 210) doPlayerAddExperience(cid, exp) doAddPokemonInDexList(cid, poke) else doShowPokedexRegistration(cid, item2, myball, leveltable) end return true end if not isPlayer(item2.uid) then return true end --alterado v2.7 \/\/ local kanto = 0 local johto = 0 for i = 1, #oldpokedex do if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[1]).dex then if i <= 151 then kanto = kanto+1 elseif i >= 209 then johto = johto+1 end end end local player = getRecorderPlayer(toPos, cid) if cid == player then doPlayerSendTextMessage(cid, 27, "Você desbloqueou "..kanto.." kanto's e "..johto.." johto's pokémons até agora.") doPlayerSetVocation(cid, 9) openChannelDialog(cid) end return true end salve e fecha. agora vai na pasta :\data\lib\some functions.lua e localiza isso "function getRecorderPlayer" cola isso no lugar : function getRecorderPlayer(pos, cid) local ret = 0 if cid and getThingPos(cid).x == pos.x and getThingPos(cid).y == pos.y then return cid end local s = {} s.x = pos.x s.y = pos.y s.z = pos.z for a = 0, 255 do s.stackpos = a local b = getTileThingByPos(s).uid if b > 1 and isPlayer(b) and getCreatureOutfit(b).lookType ~= 814 then ret = b end end return ret end salve e fecha. a Pokedex deve ficar assim. Credito: Kibbutz: por ter disponibilizado esse tutorial Ao usar a pokedex no pokemon fica só nisso. 19:25 You have gained 60 experience points. 19:25 You have unlocked Rattata in your pokedex! 19:25 You have gained 60 experience points. 19:25 You have unlocked Rattata in your pokedex! 19:25 You have gained 60 experience points. Não aparece as informações do pokemon. Acho que assim funciona: function onUse(cid, item, fromPos, itemEx, toPos)function isSummon(sid)for i, pid in ipairs(getPlayersOnline()) dofor c, cid in pairs(getCreatureSummons(pid)) doif (cid == sid) thenreturn trueendendendreturn falseendlocal pokemon = itemEx.uidlocal pokemons = {{"Bulbasaur", 20, 1001},{"Ivysaur", 40, 1002},{"Venusaur", 75, 1003},{"Charmander", 20, 1004},{"Charmeleon", 40, 1005},{"Charizard", 75, 1006},{"Squirtle", 20, 1007},{"Wartortle", 40, 1008},{"Blastoise", 75, 1009},{"Caterpie", 5, 1010},{"Metapod", 10, 1011},{"Butterfree", 30, 1012},{"Weedle", 5, 1013},{"Kakuna", 10, 1014},{"Beedrill", 30, 1015},{"Pidgey", 5, 1016},{"Pidgeotto", 20, 1017},{"Pidgeot", 65, 1018},{"Rattata", 5, 1019},{"Raticate", 25, 1020},{"Spearow", 5, 1021},{"Fearow", 50, 1022},{"Ekans", 12, 1023},{"Arbok", 30, 1024},{"Pikachu", 20, 1025},{"Raichu", 45, 1026},{"Sandshrew", 18, 1027},{"Sandslash", 55, 1028},{"Nidoran Female", 10, 1029},{"Nidorina", 25, 1030},{"Nidoqueen", 65, 1031},{"Nidoran Male", 10, 1032},{"Nidorino", 25, 1033},{"Nidoking", 65, 1034},{"Clefairy", 10, 1035},{"Clefable", 35, 1036},{"Vulpix", 20, 1037},{"Ninetales", 65, 1038},{"Jigglypuff", 10, 1039},{"Wigglytuff", 42, 1040},{"Zubat", 10, 1041},{"Golbat", 30, 1042},{"Oddish", 5, 1043},{"Gloom", 10, 1044},{"Vileplume", 50, 1045},{"Paras", 5, 1046},{"Parasect", 50, 1047},{"Venonat", 18, 1048},{"Venomoth", 50, 1049},{"Diglett", 5, 1050},{"Dugtrio", 35, 1051},{"Meowth", 12, 1052},{"Persion", 25, 1053},{"Psyduck", 12, 1054},{"Golduck", 55, 1055},{"Mankey", 10, 1056},{"Primeape", 45, 1057},{"Growlithe", 20, 1058},{"Arcanine", 75, 1059},{"Poliwag", 5, 1060},{"Poliwhirl", 20, 1061},{"Poliwrath", 65, 1062},{"Abra", 15, 1063},{"Kadabra", 45, 1064},{"Alakazam", 75, 1065},{"Machop", 18, 1066},{"Machoke", 40, 1067},{"Machamp", 65, 1068},{"Bellsprout", 5, 1069},{"Weepinbell", 27, 1070},{"Victreebel", 50, 1071},{"Tentacool", 12, 1072},{"Tentacruel", 70, 1073},{"Geodude", 12, 1074},{"Graveler", 40, 1075},{"Golem", 65, 1076},{"Ponyta", 20, 1077},{"Rapidash", 60, 1078},{"Slowpoke", 12, 1079},{"Slowbro", 45, 1080},{"Magnemite", 15, 1081},{"Magneton", 40, 1082},{"Farfetchd", 40, 1083},{"Doduo", 12, 1084},{"Dodrio", 45, 1085},{"Seel", 20, 1086},{"Dewgong", 65, 1087},{"Grimer", 12, 1088},{"Muk", 30, 1089},{"Shellder", 5, 1090},{"Cloyster", 65, 1091},{"Gastly", 18, 1092},{"Haunter", 45, 1093},{"Gengar", 80, 1094},{"Onix", 50, 1095},{"Drowzee", 22, 1096},{"Hypno", 50, 1097},{"Krabby", 5, 1098},{"Kingler", 35, 1099},{"Voltorb", 14, 1100},{"Electrode", 38, 1101},{"Exeggcute", 8, 1102},{"Exeggutor", 48, 1103},{"Cubone", 18, 1104},{"Marowak", 45, 1105},{"Hitmonlee", 55, 1106},{"Hitmonchan", 55, 1107},{"Lickitung", 45, 1108},{"Koffing", 15, 1109},{"Weezing", 30, 1110},{"Rhyhorn", 35, 1111},{"Rhydon", 55, 1112},{"Chansey", 50, 1113},{"Tangela", 20, 1114},{"Kangaskhan", 60, 1115},{"Horsea", 5, 1116},{"Seadra", 45, 1117},{"Goldeen", 10, 1118},{"Seaking", 25, 1119},{"Staryu", 15, 1120},{"Starmie", 45, 1121},{"Mr.mime", 60, 1122},{"Scyther", 70, 1123},{"Jynx", 65, 1124},{"Electabuzz", 70, 1125},{"Magmar", 70, 1126},{"Pinsir", 42, 1127},{"Tauros", 40, 1128},{"Magikarp", 1, 1129},{"Gyarados", 75, 1130},{"Shiny Gyarados", 175, 167},{"Lapras", 70, 1131},{"Ditto", 40, 1132},{"Eevee", 20, 1133},{"Vaporeon", 55, 1134},{"Jolteon", 55, 1135},{"Flareon", 55, 1136},{"Porygon", 45, 1137},{"Omanyte", 20, 1138},{"Omastar", 70, 1139},{"Kabuto", 20, 1140},{"Kabutops", 70, 1141},{"Aerodactyl", 110, 1142},{"Snorlax", 85, 1143},{"Articuno", 110, 1144},{"Zapdos", 110, 1145},{"Moltres", 110, 1146},{"Dratini", 10, 1147},{"Dragonair", 70, 1148},{"Dragonite", 110, 1149},{"Mewtwo", 110, 1150},{"Mew", 110, 1151},}for _,n in pairs(pokemons) doif isSummon(pokemon) thenif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[2] and getPlayerStorageValue(cid, n[3]) <= 0 thenj = (n[2]) *10doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!")doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.")doSendMagicEffect(getThingPos(cid), 210)doPlayerAddExperience(cid, (n[2])*10)setPlayerStorageValue(cid, n[3], 1)elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[2] and getPlayerStorageValue(cid, n[3]) <= 0 thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be at least level " .. n[2] .. " to unlock this pokemon.")elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 thenlocal v = ((n[3]) + 1376)local dexstring = ""..n[1]..".txt"local Dex = io.open('data/pokedex/'..dexstring, 'r')doShowTextDialog(cid, (v), Dex:read("*all"))Dex:close()endelseif isMonster(pokemon) thenif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) <= 0 thenj = (n[2]) *10doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex!")doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. j .. " experience points.")doSendMagicEffect(getThingPos(cid), 210)doPlayerAddExperience(cid, (n[2])*10)setPlayerStorageValue(cid, n[3], 1)elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[3]) >= 1 thenlocal v = ((n[3]) + 1376)local dexstring = ""..n[1]..".txt"local Dex = io.open('data/pokedex/'..dexstring, 'r')doShowTextDialog(cid, v, Dex:read("*all"))Dex:close()endendendlocal store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}local unlock = {}if not isCreature(itemEx.uid) thenreturn trueendfor i = 1, #store doif getPlayerStorageValue(itemEx.uid, tonumber(store[i])) > 0 thentable.insert(unlock, 1)endendif isPlayer(itemEx.uid) thensetPlayerStorageValue(cid, 7274, 1)if getCreatureName(cid) == getCreatureName(itemEx.uid) thendoPlayerSendTextMessage(cid, 27, "You have unlocked " .. #unlock .. " pokemons already.")doPlayerSendTextMessage(cid, 27, "You can open a pokedex entry by typing \"/dex \". Example: \"/dex Pikachu\".")elsedoPlayerSendTextMessage(cid, 27, getPlayerName(itemEx.uid) .. " has unlocked " .. #unlock .. " pokemons already.")endendreturn trueend Assim não funciono amigo o erro persiste. Editado Janeiro 19, 2015 10 anos por lessa1994 (veja o histórico de edições) Nunca foi tão fácil jogar Pokémon!
Postado Janeiro 20, 2015 10 anos eae man aqui funcionou n entendo mt disso ent eu achei o tutorial que te passei para ver se funcionava com vc. minha pokedex ficou assim e quando eu clicko em mim ficva assim: Editado Janeiro 20, 2015 10 anos por jjailton (veja o histórico de ediçõ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.