Jump to content

Script doesn't work


BriGhtx3

Recommended Posts

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"!

Link to comment
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) 
  

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