BriGhtx3 Posted October 8, 2011 Share Posted October 8, 2011 (edited) 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 October 8, 2011 by Guest Link to comment
BinSlayer1 Posted October 8, 2011 Share Posted October 8, 2011 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
BriGhtx3 Posted October 8, 2011 Author Share Posted October 8, 2011 Fixed Problem. GuiEditor_Label had to be defined. Link to comment
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