Jump to content

Recommended Posts

Tentei fazer esse script de /ve ID. Ver o dinheiro q o player com o certo ID tem
Porem não esta dando certo

 

function getPlayerID(id)
	v = false
	for i, player in ipairs (getElementsByType("player")) do
		if getElementData(player, "ID") == id then
			v = player
			break
		end
	end
	return v
end

function getnick(player, command, id, ...)
		local accName = getAccountName ( getPlayerAccount ( player ) )
		if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then
    local Dinheiro = getPlayerMoney(Player2)
    setElementData(player, "Suspeito:Dinheiro",Dinheiro)
    if(id) then
        local playerID = tonumber(id)
		if(playerID) then
			local Player2 = getPlayerID(playerID)
			if(Player2) then	
				outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. Dinheiro .."", player, 255,255,255,true)
			else
				outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true)
			end 
		else
			outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true)
		end
	else
		outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /ve #00ff00[#ffffffID#00ff00]", player, 255,255,255,true)
	end
end
end
addCommandHandler("ve", getnick)

 

Edited by zW1Z4RD
Link to comment

Não testei mas creio que funcione:

function getPlayerID(id)
	v = false
	for i, player in ipairs (getElementsByType("player")) do
		if getElementData(player, "ID") == id then
			v = player
			break
		end
	end
	return v
end

function verMoney(player, command, id, ...)
	if hasObjectPermissionTo("player", "command.ban") == false then return end
    if(id) then
        local playerID = tonumber(id)
		if(playerID) then
			local Player2 = getPlayerID(playerID)
			if(Player2) then	
        		local money = getPlayerMoney(Player2)
				outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true)
			end
		end
	end
end
addCommandHandler("ve", verMoney)

Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor.

Link to comment
2 hours ago, ber said:

Não testei mas creio que funcione:


function getPlayerID(id)
	v = false
	for i, player in ipairs (getElementsByType("player")) do
		if getElementData(player, "ID") == id then
			v = player
			break
		end
	end
	return v
end

function verMoney(player, command, id, ...)
	if hasObjectPermissionTo("player", "command.ban") == false then return end
    if(id) then
        local playerID = tonumber(id)
		if(playerID) then
			local Player2 = getPlayerID(playerID)
			if(Player2) then	
        		local money = getPlayerMoney(Player2)
				outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true)
			end
		end
	end
end
addCommandHandler("ve", verMoney)

Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor.

Creio eu, que o "player" na linha 13,  tem de ser fora das aspas (" ")

Link to comment
4 hours ago, ber said:

Não testei mas creio que funcione:


function getPlayerID(id)
	v = false
	for i, player in ipairs (getElementsByType("player")) do
		if getElementData(player, "ID") == id then
			v = player
			break
		end
	end
	return v
end

function verMoney(player, command, id, ...)
	if hasObjectPermissionTo("player", "command.ban") == false then return end
    if(id) then
        local playerID = tonumber(id)
		if(playerID) then
			local Player2 = getPlayerID(playerID)
			if(Player2) then	
        		local money = getPlayerMoney(Player2)
				outputChatBox("O jogador "..Player2.." possui: $"..money, player, 255, 255, 255, true)
			end
		end
	end
end
addCommandHandler("ve", verMoney)

Você pode alterar o hasObjectPermissionTo por isObjectInACLGroup caso ache melhor.

Esta dando error na linha 24
Edit: Arrumei

Edited by zW1Z4RD
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...