Postado Junho 7, 2017 8 anos Seguinte Galera tenho 2 Scripts de Look Player O Primeiro é Fica Assim quando da Look no Player! Citar You see Teste (Level 8). He is a elder druid. He is Leader of the Malucos (Zicao). Ele Matou: [2] Jogadores. Ele Morreu: [1] Jogadores Aqui está o Script Spoiler function onLook(cid, thing, position, lookDistance) function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Jogadores") end return true end E Tenho Este Script de Rank Militar em Mods Spoiler <?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "ranks"><![CDATA[ titles = { [5] = "Private First Class", [10] = "Specialist", [15] = "Corporal", [20] = "Sergeant", [25] = "Staff Sergeant", [30] = "Sergeant First Class", [35] = "Master Sergeant", [40] = "First Sergeant", [45] = "Sergeant Major", [50] = "Command Sergeant Major", [55] = "Sergeant Major of the Army", [60] = "Second Lieutenant", [65] = "First Lieutenant", [70] = "Captain", [75] = "Major", [80] = "Lieutenant Colonel", [90] = "Colonel", [100] = "Brigadier General", [110] = "Major General", [120] = "Lieutenant General", [140] = "General", [170] = "General of the Army" } fragsStorage = 600 ]]></config> <event type = "look" name = "ranksLook" event = "script"><![CDATA[ domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Private", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank) end return true end ]]></event> <event type = "kill" name = "ranksKill" event = "script"><![CDATA[ domodlib("ranks") function onKill(cid, target) if(isPlayer(target)) then setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1)) if(titles[getPlayerStorageValue(cid, fragsStorage)]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!") end end return true end ]]></event> <event type = "login" name = "ranksLogin" event = "script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "ranksKill") registerCreatureEvent(cid, "ranksLook") return true end ]]></event> </mod> Queria Juntar os Dois, Tipo na hora de dar look mostrar o level,guild,frags,dead e rank militar Exemplo; Citar You see Teste (Level 8). He is a elder druid. He is Leader of the Malucos (Zicao). Ele Matou: [2] Jogadores. Ele Morreu: [1] Jogadores Rank Militar:Private First Class Alguem que entenda de Scripts,.... Poderia fazer para min ? Ficaria muito Grato Mesmo e me Ajudaria Muuuuuitooo! DOU MUITO REPS ! Prometo Editado Junho 7, 2017 8 anos por DigoleraZica Erro de Escrita =s (veja o histórico de edições)
Postado Junho 7, 2017 8 anos function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Jogadores") end <?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "ranks"><![CDATA[ titles = { [5] = "Private First Class", [10] = "Specialist", [15] = "Corporal", [20] = "Sergeant", [25] = "Staff Sergeant", [30] = "Sergeant First Class", [35] = "Master Sergeant", [40] = "First Sergeant", [45] = "Sergeant Major", [50] = "Command Sergeant Major", [55] = "Sergeant Major of the Army", [60] = "Second Lieutenant", [65] = "First Lieutenant", [70] = "Captain", [75] = "Major", [80] = "Lieutenant Colonel", [90] = "Colonel", [100] = "Brigadier General", [110] = "Major General", [120] = "Lieutenant General", [140] = "General", [170] = "General of the Army" } fragsStorage = 600 function getDeathsAndKills(cid, type) -- by vodka local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end ]]></config> <event type = "look" name = "ranksLook" event = "script"><![CDATA[ domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Private", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Vezes.\n Military rank: " .. rank.rank) end return true end ]]></event> <event type = "kill" name = "ranksKill" event = "script"><![CDATA[ domodlib("ranks") function onKill(cid, target) if(isPlayer(target)) then setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1)) if(titles[getPlayerStorageValue(cid, fragsStorage)]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!") end end return true end ]]></event> <event type = "login" name = "ranksLogin" event = "script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "ranksKill") registerCreatureEvent(cid, "ranksLook") return true end ]]></event> </mod> [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 7, 2017 8 anos Autor @Vodkart Apareceu este erro na minha otx 8.6 ao abrir ela Spoiler [Error - Test Interface] data/creaturescripts/scripts/KillsandDeath.lua Description: data/creaturescripts/scripts/KillsandDeath.lua:11: attempt to index global 'thing' (a nil value) [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/KillsandDeath.lua) entrei no jogo e dei look apareceu isso na otx \/ Spoiler [Error - CreatureScript Interface] domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Private", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Matou: ["..getDeathsAndKills(thing.uid, "kill").."] Jogadores.\n"..(getPlayerSex(thing.uid) == 0 and "Ela" or "Ele").." Morreu: ["..getDeathsAndKills(thing.uid, "death").."] Vezes.\n Military rank: " .. rank.rank) end return true end :onLook Description: [string "LuaInterface::loadBuffer"]:6: bad argument #3 to 'max' (number expected, got nil) stack traceback: [C]: in function 'max' [string "LuaInterface::loadBuffer"]:6: in function <[string "LuaInterface::loadBuffer"]:2> Editado Junho 7, 2017 8 anos por DigoleraZica (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.