BriGhtx3 Posted September 25, 2011 Posted September 25, 2011 blitzer.lua local distanz = createMarker ( -2006, 146, 28, cylinder, 10, 0, 0, 0, 0 ) function blitzer(hitElement, matchingDimension) speedx, speedy, speedz = getElementVelocity (hitElement) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) mps = actualspeed * 50 kmh = actualspeed * 180 mph = actualspeed * 111.847 geld = kmh/100*200 if kmh > 100 then outputChatBox ( "Du hast die maximale Geschwindkeit überstritten!", hitElement, 255, 0, 0) outputChatBox ( "Als Strafe wurden dir "..math.ceil(geld).."$ abgezogen!", hitElement, 255, 0, 0) triggerClientEvent(hitElement, "onStrafe", getRootElement()) setPlayerMoney(hitElement, -math.ceil(tonumber(geld))) end end addEventHandler("onMarkerHit", distanz, blitzer) blitzer_client.lua: function StrafHandler ( ) guiCreateStaticImage( 20,200, 400, 600, "blitzer/blitzer.png", false ) outputChatBox("Test") end addEvent( "onStrafe", true ) addEventHandler( "onStrafe", getRootElement(), StrafHandler ) The Problem is that the image doesn't show. It is in the meta.xml : <file src="blitzer/blitzer.png" /> And YES it is in the folder "blitzer"! Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
BinSlayer1 Posted September 25, 2011 Posted September 25, 2011 local distanz = createMarker ( -2006, 146, 28, cylinder, 10, 0, 0, 0, 0 ) function blitzer(hitElement, matchingDimension) if getElementType(hitElement) ~= "vehicle" then return end local player = getVehicleController(hitElement) speedx, speedy, speedz = getElementVelocity (hitElement) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) mps = actualspeed * 50 kmh = actualspeed * 180 mph = actualspeed * 111.847 geld = kmh/100*200 if kmh > 100 then outputChatBox ( "Du hast die maximale Geschwindkeit überstritten!", player, 255, 0, 0) outputChatBox ( "Als Strafe wurden dir "..math.ceil(geld).."$ abgezogen!", player, 255, 0, 0) triggerClientEvent(player, "onStrafe", getRootElement()) setPlayerMoney(player, -math.ceil(tonumber(geld))) end end addEventHandler("onMarkerHit", distanz, blitzer)
BriGhtx3 Posted September 25, 2011 Author Posted September 25, 2011 Alright thank you. Now how do I hide the picture after 10 seconds? Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
BinSlayer1 Posted September 25, 2011 Posted September 25, 2011 use setTimer and guiSetVisible? https://wiki.multitheftauto.com/wiki/SetTimer https://wiki.multitheftauto.com/wiki/GuiSetVisible
BriGhtx3 Posted September 25, 2011 Author Posted September 25, 2011 Yes I didn't know if i can use guisetvisible for pictures Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Castillo Posted September 25, 2011 Posted September 25, 2011 guiSetVisible can be used in EVERY GUI element, not DX drawing though. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now