Jump to content

TriggerClientEvent


BriGhtx3

Recommended Posts

server :

  
function blitzer(hitElement, matchingDimension) 
speedx, speedy, speedz = getElementVelocity (hitElement) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
geld = kmh/100*200       
triggerClientEvent(hitElement,"onStrafe", getRootElement(), kmh, geld) 
end 

client :

function StrafHandler ( gesch, money ) 
  
img = guiCreateStaticImage(392,0,407,268,"Blitzer/Blitzer.png",false) 
guiSetAlpha(img,0.89999997615814) 
GUIEditor_Label[3] = guiCreateLabel(741,137,46,30,gesch,false,img) 
guiLabelSetColor(GUIEditor_Label[3],0,0,0) 
guiSetFont(GUIEditor_Label[3],"sa-header") 
  
        end 
addEvent( "onStrafe", true ) 
addEventHandler( "onStrafe", getRootElement(), StrafHandler ) 
  

Why doesn't it work?

Server triggered client-side Event, but event is not added clientside.

Edited by Guest
Link to comment

Client hasn't finished downloading files and you request the client to run files when it is still downloading them.

clientside even onClientResourceStart triggers when client downloads are complete and you can use this to tell the server that the client is ready to execute scripts.

Either this, or the meta.xml is not correctly set up to load the client file as well

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