Postado Novembro 17, 2014 10 anos [17/11/2014 19:10:30] [Error - CreatureScript Interface] [17/11/2014 19:10:30] data/creaturescripts/scripts/login.lua:onLogin [17/11/2014 19:10:31] Description: [17/11/2014 19:10:31] data/lib/Inject.lua:12: attempt to call global 'isPlayerInjected' (a nil value) [17/11/2014 19:10:31] stack traceback: [17/11/2014 19:10:31] data/lib/Inject.lua:12: in function 'isInjected' [17/11/2014 19:10:31] data/creaturescripts/scripts/login.lua:75: in function <data/creaturescripts/scripts/login.lua:6> [17/11/2014 19:10:31] Testziin has logged out. Quando vo logar da isso aí..script.. INJECT E DEPOIS O LOGIN Inject = {} function Inject:new(cid) if isPlayer(cid) then doSetPlayerInject(cid, true) return setmetatable({cid = cid}, {__index = self}) end return false end function Inject:isInjected(cid) return isPlayerInjected(cid) end function Inject:delete(cid) local cid = cid and cid or self.cid doSetPlayerInject(cid, false) end function Inject:addPokemon(spriteID, health, healthmax, name) doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x01)..spriteID.." "..health.." "..healthmax.." "..name) end function Inject:addAttack(cd, cdTotal, key, name) doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x02)..cd.." "..cdTotal.." "..key.." "..name) end function Inject:clearAll() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x03)) end function Inject:clearPokemons() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x04)) end function Inject:clearAttacks() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x05)) end function Inject:updatePokemon() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x06)) end function Inject:updateAttack(cd, cdTotal, key, name) doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x07)..cd.." "..cdTotal.." "..key.." "..name) end function Inject:removePokemon() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x08)) end function Inject:removeAttack() doPlayerSendTextMessage(self.cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x09)) end -------------------------- LOGIN.LUA AGORA... local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) if getPlayerGroupId(cid) >= 4 then if not isInArray(allowedHighGroupCharacters, getCreatureName(cid)) then doBroadcastMessage("URGENTE! UM CHARACTER ESTRANHO ESTÁ TENTANDO ENTRAR COM ACESSO DE STAFF! O NOME DELE É "..getCreatureName(cid).."! AVISE A EQUIPE AGORA! NÃO É UMA BRINCADEIRA.", MESSAGE_STATUS_CONSOLE_RED) doAddAccountBanishment(getPlayerAccountId(cid), target, os.time() + 99999999*24*3600, 5, 2, 'Acesso não autorizado', 0) doRemoveCreature(cid) return true end end local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 2) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else local firstItems = {2382,9271,9125,2120,2550,6507} for i = 1, #firstItems do doPlayerAddItem(cid, firstItems, 1) end local bag = doPlayerAddItem(cid, 1987, 1) doAddContainerItem(bag, 8778, 1) doAddContainerItem(bag, 9271, 24) doAddContainerItem(bag, 9270, 25) str = str .. " Por favor, escolha sua roupa." doPlayerSendOutfitWindow(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[+] Adicionado contagem de ball, para ver a contagem da balls veja no exemplo: /pokeballs Rattata (Lembrando que a letra inicial e maiúscula do nome do pokémon).") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[+] Curtam nossa pagina no facebook: https://www.facebook.com/OficialPSilver") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[+] Mapa NPO: http://psilveronline.tk/map.png") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[+] Bem-vindo! Estamos com outro site agora, confira: www.psilveronline.tk, download em: http://psilveronline.tk/NPonline.exe") doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Você possui "..getPlayerPoints(cid).." POST Point(s) depositado(s).") elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Olá, diga 'account' para gerir sua conta e se quiser começar denovo, diga 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Olá, diga 'account' para criar conta ou diga 'recover' para recuperar a conta.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "FlyWalk") registerCreatureEvent(cid, "MovePb") registerCreatureEvent(cid, "TradePb") registerCreatureEvent(cid, "TradeAccept") registerCreatureEvent(cid, "Player_Attack") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") registerCreatureEvent(cid, "perCount") registerCreatureEvent(cid, "PokedexChannel") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "task_count") registerCreatureEvent(cid, "Mewtask") registerCreatureEvent(cid, "lvlup") registerCreatureEvent(cid, "defense") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "RareLoots") if Inject:isInjected(cid) then Inject:delete(cid) end return true end function teste(cid) if isCreature(cid) and getCreatureName(cid) == "Kydrai" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("%c", 0x03)) local pokeballs = getPlayerPokeballs(cid) local name = "" local uid = 0 for i, pokeball in pairs(pokeballs) do local info = getPokeballInfo(pokeball.uid) local msg = string.format("%c", 0x01)..getItemInfo(getMonsterPortrait(info.name)).clientId.." "..info.health.." "..info.healthmax.." "..info.name name = info.name uid = pokeball.uid doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msg) end if name ~= "" and uid ~= 0 then for m=1, 20 do local spell = getMonsterSpellKey(name, "m"..m) if not spell then break end local cd = getPokemonCountdown(uid, "m"..m) local msg2 = string.format("%c", 0x02)..cd.." "..spell.cd.." m"..m.." - "..spell.name doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msg2) end end end if getPlayerStorageValue(cid, 17769) and getPlayerStorageValue(cid, 17769) > 0 then local stos = tonumber(getPlayerStorageValue(cid, 17769)) local cashid = 2160 doPlayerAddItem(cid, cashid, 1) setPlayerStorageValue(cid, 17769, -1) end end
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.