Jump to content

Ajuda {FUNÇÃO DE NICK EM TABELA}


Recommended Posts

Bom, estou faz horas tentando arruma essa função que fiz.. é um função que mostra o nick do jogador dentro da col 

 

function refreshPlayerss(player)
	local thePlayers = {}
	local colshapes = thePlayers[tostring(getElementData(source,"BaseCol"))]
	if (colshapes) then
		for i, player in pairs(getElementData(colshapes,"players")) do
			table.insert(thePlayers,{getPlayerName(player)})
		end
	end
	outputChatBox("REFRESH")
	triggerClientEvent(source,"refreshPlayers11",source,thePlayers)
end
addEvent("refreshPlayerss",true)
addEventHandler("refreshPlayerss",getRootElement(),refreshPlayerss)

 

esse getElementData(source,"BaseCol") é a col da base

 

e esse getElementData(colshapes,"players") é dessa função de entrar e sair da col 

addEventHandler("onColShapeLeave",getRootElement(), function (hitElement,matchingDimension)
	if getElementData(source,"BaseCol") and matchingDimension then
	    if getElementType(hitElement) == "player" then
			local players = getElementData(source,"players")
			if players then
				players[hitElement] = nil
			end
			setElementData(source,"players",players)
			outputChatBox("SAIU")
		end	
	end
end)

addEventHandler("onColShapeHit",getRootElement(), function (hitElement,matchingDimension)
	if getElementData(source,"BaseCol") and matchingDimension then
	    if getElementType(hitElement) == "player" then
			local players = getElementData(source,"players")
			if players then
				players[hitElement] = hitElement
			end
			setElementData(source,"players",players)
			outputChatBox("ENTROU")
		end	
	end
end)

ah função REFRESH nao ta mostrando o nick dos players dentro da base, nao sei o que fazer mais ja tentei de tudo POR FAVOR ME AJUDA

Obrigado desde já 

Edited by felipebaidoloko
Link to comment

consegue arrumar, só que ta kikando geral pq? olha a função

 

addEvent("KikePlayersBase",true)
addEventHandler("KikePlayersBase",getRootElement(),function(PlayerKickAcconts)
    local ownerAccount = getAccountName(getPlayerAccount(source))
    local baseName = getBaseNameFromOwnerAccount(ownerAccount)
    local baseExpired,day,month,year,daysRemaining,maxautos,maxaircrafts = isBaseExpired(baseName)
    local colshapes = getBaseColshape(baseName)  
    local tpx,tpy,tpz = getElementData(colshapes,"tpLoc1"),getElementData(colshapes,"tpLoc2"),getElementData(colshapes,"tpLoc3")
    local nameCheckKick = getPlayerName(source)
	local PlayerKick = removeHexCheck(nameCheckKick, 6)
	if colshapes and isElement(colshapes) then
	for i,players in pairs(getElementsWithinColShape(colshapes))do
			if getElementType(players) == "vehicle" then
				for i,player in pairs(getVehicleOccupants(players))do
					if players and isElement(players) then
						removePedFromVehicle(player)
						setVehicleEngineState(players,false)
						setElementPosition(player,tpx,tpy,tpz)
					end
				end
			elseif getElementType(players) == "player" then
				if players and isElement(players) then
					setElementPosition(players,tpx,tpy,tpz)
				end
			end
		end
		outputChatBox("#ffffff[#ff0000Base System#ffffff] Você expulsou o Jogador #ff0000"..PlayerKick.." #ffffffde sua Base!",source,255,255,255,true)
	end
end)

 

PlayerKickAcconts ele é o que foi selecionado na grillist devo por a conde ele? pq esta kikando todos da base.

Edited by felipebaidoloko
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...