Voltex'GNR Posted August 17, 2016 Share Posted August 17, 2016 Here is my code local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("Updates", screenW 0.7891, screenH 0.7598, screenW 0.9187, screenH 0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) end ) When I use this, this error comes IDK why ')' expected near '0.7891 In this line dxDrawText("Updates", screenW 0.7891, screenH 0.7598, screenW 0.9187, screenH 0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) Link to comment
roaddog Posted August 17, 2016 Share Posted August 17, 2016 dxDrawText("Updates", screenW*0.7891, screenH*0.7598, screenW*0.9187, screenH*0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 local col3 = createColSphere ( 1787.3724365234, 1608.2197265625, 6.734375, 1000 ) function onPlayerJoin(thePlayer) isElementWithinColShape ( thePlayer, col3 ) end addEvent("onColShapeHit") addEventHandler ( "onColShapeHit", col3, onPlayerJoin ) I want trigger onColShape hit this dxDraw dxDrawText("Updates", screenW*0.7891, screenH*0.7598, screenW*0.9187, screenH*0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) get showen, I tried but I failed any one help me? Link to comment
Wumbaloo Posted August 17, 2016 Share Posted August 17, 2016 Like this ? local col3 = createColSphere ( 1787.3724365234, 1608.2197265625, 6.734375, 1000 ) function onPlayerJoin(thePlayer) if isElementWithinColShape ( thePlayer, col3 ) then addEventHandler("onClientRender", getRootElement(), dxDraw) end end addEvent("onColShapeHit") addEventHandler ( "onColShapeHit", col3, onPlayerJoin ) function dxDraw() dxDrawText("Updates", screenW*0.7891, screenH*0.7598, screenW*0.9187, screenH*0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) end Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 it doesn't work* Can you fix it? Link to comment
Wumbaloo Posted August 17, 2016 Share Posted August 17, 2016 (edited) Here's when a player join the server All is client, do you want this on server side ? local screenW, screenH = guiGetScreenSize() function onPlayerJoin() local col3 = createColSphere ( 1787.3724365234, 1608.2197265625, 6.734375, 1000 ) setTimer(function () if isElementWithinColShape ( getLocalPlayer(), col3 ) then addEventHandler("onClientRender", getRootElement(), dxDraw) end end, 50, 1) end addEvent("onClientResourceStart") addEventHandler ( "onClientResourceStart", getRootElement(), onPlayerJoin ) function dxDraw() dxDrawText("Updates", screenW*0.7891, screenH*0.7598, screenW*0.9187, screenH*0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) end Edited August 17, 2016 by Guest Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 Man function xDraw should be Client and The other server Any one help me PLease? Link to comment
Wumbaloo Posted August 17, 2016 Share Posted August 17, 2016 This is client sided, it work, i tested it. You want a server side too ? I can do this. Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 This is client sided, it work, i tested it.You want a server side too ? I can do this. I want when the play hit the colshape Link to comment
Wumbaloo Posted August 17, 2016 Share Posted August 17, 2016 You want when the player join the game or every time ? Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 No When the Player join the Colshape it appears for 1minute and When player leave colshape it remove the appear. Link to comment
Wumbaloo Posted August 17, 2016 Share Posted August 17, 2016 I don't understand your english Someone else ? Link to comment
Voltex'GNR Posted August 17, 2016 Author Share Posted August 17, 2016 Man, Just make it when some one enter the Col Shape he gets the DX message for 1minute. And When you leave the Col Shape, the message go. Link to comment
Wumbaloo Posted August 18, 2016 Share Posted August 18, 2016 I think I got you -- Server Side: function resourceStart() local col3 = createColSphere ( 0, 0, 5, 3 ) for _, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, col3) then setTimer(function (thePlayer) triggerClientEvent("colshape:toggleDXRender", thePlayer) end, 50, 1, player) end end addEventHandler("onColShapeHit", col3, colShapeHit) addEventHandler("onColShapeLeave", col3, colShapeLeave) end addEventHandler("onResourceStart", getRootElement(), resourceStart) function colShapeHit(element, dimension) if getElementType(element) == "player" and dimension then triggerClientEvent("colshape:toggleDXRender", element) end end function colShapeLeave(element, dimension) if getElementType(element) == "player" and dimension then triggerClientEvent("colshape:toggleDXRender", element) end end -- Client Side local screenW, screenH = guiGetScreenSize() function toggleDXRender() dxRenderState = not dxRenderState if dxRenderState then addEventHandler("onClientRender", getRootElement(), dxDraw) dxRemoveDrawTimer = setTimer(function () removeEventHandler("onClientRender", getRootElement(), dxDraw) end, 1000*60, 1) else removeEventHandler("onClientRender", getRootElement(), dxDraw) end end addEvent("colshape:toggleDXRender", true) addEventHandler("colshape:toggleDXRender", getRootElement(), toggleDXRender) function dxDraw() dxDrawText("Updates", screenW*0.7891, screenH*0.7598, screenW*0.9187, screenH*0.8076, tocolor(255, 27, 27, 255), 1.00, "pricedown", "left", "top", false, false, false, false, false) end 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