Annas Posted February 26, 2016 Share Posted February 26, 2016 Hello , i have made a simple script wish replaces a gate Texture.. --CLIENT SIDE ---------------------------------------------------------------------- local group = "LogiC" -- ADD THE GROUP NAME HERE ------------------------ local LogiC_marker = createMarker ( 3230.0249023438, 1057.3933105469, 32.006248474121, "cylinder", 15, 44, 44, 44, 0 ) local LogiC_gate = createObject ( 980, 3230.4418945312, 1057.2094726562, 34.706253051758, 0, 0, 90 ) applyCustomTextures( LogiC_gate, "testing") ------------------------------------------------------------------------ addEventHandler ( "onMarkerHit", LogiC_marker, function ( hitElement ) if ( getElementType ( hitElement ) == "player" ) then if ( getElementData(hitElement,"g") == group ) or (exports.CSTalliance:getPlayerAlliance(hitElement, group)) or (exports.CSTteams:isPlayerInTeams(hitElement, "Staff")) then moveObject ( LogiC_gate, 400, 3230.4418945312, 1057.2094726562, 29.07536315918 ) end end end ) addEventHandler ( "onMarkerLeave", LogiC_marker, function ( leftElement ) if ( getElementType ( leftElement ) == "player" ) then if ( getElementData(leftElement,"g") == group ) or (exports.CSTalliance:getPlayerAlliance(leftElement, group)) or (exports.CSTteams:isPlayerInTeams(leftElement, "Staff")) then moveObject ( LogiC_gate, 400, 3230.4418945312, 1057.2094726562, 34.706253051758 ) end end end ) ------------------------------------------------------------------------ function applyCustomTextures(object, texture) local shaderElement = dxCreateShader ( "shaders/shader.fx", 0, 0, false, "all" ) --shader = dxCreateShader( "shader.fx", 0, 0, false, "object") texture = dxCreateTexture( "textures/"..texture..".png" ) dxSetShaderValue( shaderElement, "Tex0", texture) texturename = engineGetModelTextureNames( object ) engineApplyShaderToWorldTexture( shaderElement, texturename, object) end DEBUGSCRIPT: attempt to call global 'dxCreateShader' (a nil value) Link to comment
ozulus Posted February 26, 2016 Share Posted February 26, 2016 Dx functions is client-sided. You can't use them in server-side. Try again in client side... Link to comment
Annas Posted February 26, 2016 Author Share Posted February 26, 2016 Dx functions is client-sided. You can't use them in server-side. Try again in client side... --CLIENT SIDE You didnt see ? :fp: Link to comment
SpecT Posted February 26, 2016 Share Posted February 26, 2016 Are you sure the type of the file isn't set to server in the meta ? Link to comment
ozulus Posted February 26, 2016 Share Posted February 26, 2016 You didnt see ? :fp: Lol, onMarkerHit and onMarkerLeave are server-sided function you can not use it in client-side. https://wiki.multitheftauto.com/wiki/OnClientMarkerHit https://wiki.multitheftauto.com/wiki/On ... arkerLeave 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