Postado Março 16, 2021 4 anos Boa tarde, tenho o seguinte script que mostra os frags e mortes ao dar look no player, porem minha database usa a tabela frags_all, como posso alterar para puxar os dados dessa tabela? 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 "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times") end return true end
Postado Março 16, 2021 4 anos só existe frag_all? provavelmente que tenha a tabela death tbm, o nome dela em si é apenas frag_all ou player_frag_all? @Lost666 Have no idea! freelance? go to my discord: sun#8860
Postado Março 16, 2021 4 anos Autor 14 minutos atrás, Sun disse: só existe frag_all? provavelmente que tenha a tabela death tbm, o nome dela em si é apenas frag_all ou player_frag_all? @Lost666 a tabela é frags_all e fica dentro de Players a death é a normal do servidor mesmo
Postado Março 16, 2021 4 anos 43 minutos atrás, Lost666 disse: a tabela é frags_all e fica dentro de Players a death é a normal do servidor mesmo 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 "`frags_all`" 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 "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times") end return true end testa desta maneira ai. Editado Março 16, 2021 4 anos por Sun (veja o histórico de edições) Have no idea! freelance? go to my discord: sun#8860
Postado Março 16, 2021 4 anos Autor a contagem de mortes funcionou, apenas os frags que não os frags vem da tabela Players dentro dos valores frags_all
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.