Ir para conteúdo

Featured Replies

Postado

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

 

Fanobet_3.jpg

  • Respostas 11
  • Visualizações 571
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

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
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 por Sun (veja o histórico de edições)

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo