Jump to content

[AJUDA] Script trabalho com LEVEL


Recommended Posts

inimarker = createMarker(2825.11694, 1295.62183, 9.76514, "cylinder", 1.5, 255, 0, 0, 100)
finmarker = createMarker(2826.12085, 1355.72925, 9.75000, "cylinder", 1.5, 255, 255, 0, 100)

iniblip = createBlipAttachedTo(inimarker, 42)

finblip = createBlipAttachedTo(finmarker, 0)
setElementVisibleTo(finmarker, root, false)
setElementVisibleTo(finblip, root, false)

vehserver = {}

addEventHandler("onMarkerHit", inimarker,
function(player)
	local lvls = tonumber(getElementData(player, "Level"))
	if lvls and lvls >= 35 then
		if not (vehserver[player]) then
			if (getElementDimension(player) == 0) then
				if vehserver[player] and isElement(vehserver[player]) then destroyElement(vehserver[player])
	            vehserver[player] = createVehicle(609,2830.94849, 1294.29333, 10.77368)
	            warpPedIntoVehicle(player, vehserver[player])
	            setElementVisibleTo(finblip, player, true)
	            setElementVisibleTo(finmarker, player, true)
				outputChatBox("#483D8B[X] #FFFFFFPara Parar de Trabalhar Digite /Cancelar", player, 255, 255, 255, true);
			end
		else
			outputChatBox("#483D8B[X] #FF3232ERRO. #FFFFFFVoçe Já Está Trabalhando].", player, 255, 255, 255, true);
		end
	else
		outputChatBox("#483D8B[X] #FF3232ERRO. #FFFFFFNecessita Estar Nivel 35 Para Continuar", player, 255, 255, 255, true);
	end
end

function fim(player)
	if vehserver[player] and isElement(vehserver[player]) then
		givePlayerMoney(player, 1000)
		destroyElement(vehserver[player])			
		setElementVisibleTo(finblip, player, false)
		setElementVisibleTo(finmarker, player, false)
		outputChatBox("#00ff00Você GANHOU R$1000", player, 255,255,255,true)
    end
end
addEventHandler("onMarkerHit", finmarker, fim)

function cancelarserver(player)
	destroyElement(vehserver[player])
	setElementVisibleTo (finblip, player, false)
	setElementVisibleTo (finmarker, player, false)
	outputChatBox("#00ff00Você Cancelou", player, 255,255,255,true)
end
addCommandHandler("cancelar", cancelarserver)

Fiz um Script bem simples mas quero que apenas pessoas com mais de level "35" possam usar esse trabalho, estou desde ontem tentando fazer isso mas não estou achando meu erro, se alguém puder me ajudar desde já agradeço.

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...