Jump to content

Overkillz

Members
  • Posts

    545
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Overkillz

  1. but it isn't in any function, even if I move it out of the function, without events, it get starts Sorry, I fixed it, I didn't was noticed that it was into the function. Sorry
  2. but If I define myshader, it will start when the resorce starts. I have tried it
  3. I tried to do this, but It didnt work function toggleWaterShaderByManager(bool) if enabled == bool then return false end enabled = bool if enabled then myShader, tec = dxCreateShader ( "data/shader/water/water.fx" ) else engineRemoveShaderFromWorldTexture ( myShader, "waterclear256" ) end end
  4. anything, experiment by myself xDD Edit: It isnt stolen, it was publicated on the community, u can check it, I can't remember the right name, but I think its tecnique water 2 or something like that.
  5. Hey dear guys, Im having an issue which I tried to disabled it setTimer, events onPlayerJoin, onPlayerLogin ...etc but it didnt work. I want to disabled the water shader when the player join because it is toggeable from the userpanel. -- -- c_water.lua -- local enabled = false function checkWaterColor() if myShader then local r,g,b,a = getWaterColor() dxSetShaderValue ( myShader, "sWaterColor", r/255, g/255, b/255, a/255 ); end end myShader, tec = dxCreateShader ( "data/shader/water/water.fx" ) addEventHandler( "onClientResourceStart", resourceRoot, function() -- Version check if getVersion ().sortable < "1.1.0" then return end -- Create shader --myShader, tec = dxCreateShader ( "data/shader/water/water.fx" ) if not myShader then outputChatBox( "Could not create shader. Please use debugscript 3" ) else --outputChatBox( "Using technique ") -- Set textures local textureVol = dxCreateTexture ( "data/shader/water/images/wavemap.dds" ); local textureCube = dxCreateTexture ( "data/shader/water/images/water_cube_env256.dds" ); dxSetShaderValue ( myShader, "sRandomTexture", textureVol ); dxSetShaderValue ( myShader, "sReflectionTexture", textureCube ); -- Apply to global txd 13 engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) -- Update water color incase it gets changed by persons unknown setTimer( function() if myShader then local r,g,b,a = getWaterColor() dxSetShaderValue ( myShader, "sWaterColor", r/255, g/255, b/255, a/255 ); end end ,100,0 ) end end ) function toggleWaterShader ( ) enabled = not enabled if enabled then waterTimer = setTimer ( checkWaterColor, 1000, 0 ) engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) else killTimer ( waterTimer ) engineRemoveShaderFromWorldTexture ( myShader, "waterclear256" ) end end function toggleWaterShaderByManager(bool) if enabled == bool then return false end enabled = bool if enabled then waterTimer = setTimer ( checkWaterColor, 1000, 0 ) engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) else killTimer ( waterTimer ) engineRemoveShaderFromWorldTexture ( myShader, "waterclear256" ) end end I have tried to add this: addEventHandler( "onClientResourceStart", resourceRoot, function() killTimer ( waterTimer ) engineRemoveShaderFromWorldTexture ( myShader, "waterclear256" ) end) I added a setTimer before but it didnt work too. I hope u can help me. Thanks and Regards.
  6. i know, but the player is in vehicle while the map is ending
  7. hey guys , im having a problem with debugscript 3, i created a radar which show nitro level and health status. well, i have another script which is respawn vehicle . when a player it is there (respawn mode) and the map ended, while travelling is being shown debugscript 3 show me these errors: local playerVehicle = getPedOccupiedVehicle(localPlayer) local vehicleHealth = getElementHealth ( playerVehicle ) local vehicleHealth = math.max(0,vehicleHealth-250) local vehicleSpeed = getElementVelocity ( playerVehicle ) sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) -- Speed vehiclekmh = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) -- Speed dxDrawImage(posx,posy*1.295,height,height2, "img/lalala.png",0,0,0,tocolor(255,255,255,255)) -- Info Imagen if sX == 1440 and sY ==900 then dxDrawRectangle(x*64, y*984, x*135/1000*vehicleHealth, y*8, tocolor(0, 255, 0, 255), true) -- Health dxDrawText(""..tostring(vehiclekmh).." km/h", x*0.5, y*1128, x*527, y*877, tocolor(255, 136, 0, 255), 1.25, "default-bold", "center", "center", false, false, true, false, false) -- Speed i tried move it out of function, but it didnt worked. i hope u can help me, thanks.
  8. Thanks but unlucky It was already added before server. I tried to add server script before and didn't work too.
  9. Hey dear community, Im having some issues on Debugscript3 which doesn't alter anything of the script but it is annoying see it when player is loggin or joining ...etc DebugScript 3 drop me this error: -- CLIENT function callClientFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onServerCallsClientFunction", true) addEventHandler("onServerCallsClientFunction", resourceRoot, callClientFunction) function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end -- SERVER function callClientFunction(client, funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the clientside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerClientEvent(client, "onServerCallsClientFunction", resourceRoot, funcname, unpack(arg or {})) end function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) I hope you can help me, IDK what is wrong there ... Thanks for your time and Regards.
  10. LOL, thanks bro, I didnt know about it ^^
  11. Thanks, but I could chose another way to dxDraw it. Now, I'm getting a problem with setAccountData. It outputChatBox me a nil value --1st script which start the 1st trigger (This is ok) (ClientSide) local userText = dxLibEditGetText(cInterface.tab_6.extraTab.edit) or "" cInterface.tab_6.extraTab.messageText = "#00FF00Preview: #FFFFFF"..userText triggerServerEvent("setAccountDataText",getLocalPlayer(),tostring(userText)) --2nd script which recieve the trigger (ServerSide) function setAccountDataText(thePlayer) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then setAccountData ( playeraccount, "nameTagText",tostring(userText) ) outputChatBox("SetAccountData setted text: "..tostring(userText)) end end addEvent ( "setAccountDataText", true ) addEventHandler ( "setAccountDataText", getRootElement(),setAccountDataText) outputChatBox that I wrote drop me "nil" after the text part. What is wrong ? I hope u can help me, thanks
  12. Thanks so much, it works perfectly ^^
  13. Still ocurring the same thing. I need to add that It drops the Warn Mensagges when I see to the player, when my camera is seeing to another place where the player doesn't stay It stops. Regards.
  14. Hey dear community, Im here with a new problem that I got. Im trying to dxDrawing a text which will show the Team of a player. It works well, but if the player isn't in a Team, DebugScript drops a lot of Warning Script: local playerTeamA = getPlayerTeam(player) local playerTeamB = getTeamName(playerTeamA) if not (playerTeamB ) then dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) else dxDrawText ( playerTeamB, sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) dxDrawText ( getPlayerNametagText(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end When the player hasn't a team: I hope you can help me. Thanks and Regards.
  15. Thanks buy it doesnt draw anything --Server function setAccountDataText(playerSource) local Cuenta = getPlayerAccount (playerSource) local userText = getAccountData(Cuenta, "userText") or "none" setElementData(playerSource, "nameTagText",tostring(userText)) end addEvent ( "setAccountDataText", true ) addEventHandler ( "setAccountDataText", getRootElement(),setAccountDataText) --Client (Draw [b](it's another Script where it will be drawed) [/b]) if (getElementData(player,"nameTagText")) then dxDrawText(getElementData(player,"nameTagText"), sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end Regards.
  16. I read it carefully and I didnt understand some parts, anyways, I'm trying this --Client (Variable and trigger) local userText = dxLibEditGetText(cInterface.tab_6.extraTab.edit) or "" triggerServerEvent("setAccountDataText",getLocalPlayer(),userText) --Server function setAccountDataText(playerSource) local Cuenta = getPlayerAccount (playerSource) setAccountData(Cuenta,"userText",tostring(userText)) setElementData(playerSource, "nameTagText",userText) end addEvent ( "setAccountDataText", true ) addEventHandler ( "setAccountDataText", getRootElement(),setAccountDataText) --Client (Where it will be drawed) if (getElementData(player,"nameTagText")) then dxDrawText(getElementData(player,"nameTagText"), sx, sy - offset, sx, sy*0.94 - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default-bold", "center", "bottom", false, false, false, true ) end What is wrong ? It dxdraw a text which says " nil " Regards.
  17. Hey guys, I want to do a dxDrawText but from userpanel where the guy can set an own mensagge and I would like to know if this is ok. --Client (Just the trigger part) triggerServerEvent("setPlayerDataText",getLocalPlayer(),usuarioTexto) --Server function setPlayerDataText(playerSource) local Cuenta = getPlayerAccount (playerSource) setAccountData(Cuenta,"usuarioTexto",tostring(usuarioTexto)) end addEvent ( "setPlayerDataText", true ) addEventHandler ( "setPlayerDataText", getRootElement(),setPlayerDataText) Thanks for your time. Regards.
  18. I know, that its so weard, but when I add it, I drop me that error. IDK why.
  19. local time = getRealTime() month = { [1] = "January", [2] = "February", [3] = "March", [4] = "April", [5] = "May", [6] = "June", [7] = "July", [8] = "August", [9] = "September", [10] = "October", [11] = "November", [12] = "December" } local nonth = time.month[month] dxDrawText(nonth..": This Month",0,140,screenWidth,screenHeight*scale,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) It doesnt work for me, it give me this error http://puu.sh/j8Jhv/554000a6fa.png
  20. Thanks guys, I needen another argument that I had forgotten. Mybad Thanks newly
  21. Hey dear community, I hope you can help me with this easy problem which I have. I want to add and see Hex colors into the text, I tried to set some arguments "true" but it didn't work. local contador = 3 local alfa = 0 local movimiento = "fadein" local screenWidth, screenHeight = guiGetScreenSize() ------------------------------------------------------------------------------ function createText () if movimiento == "fadein" then contador = contador+1 else contador = contador-1 end if contador <= 100 then alfa = 255*(contador/100) end dxDrawText("#000000"..getPlayerName(getLocalPlayer()).." #000000is the final survivor!", screenWidth/2, screenHeight/3, screenWidth/2, screenHeight/3.5, tocolor ( 255,255, 255, alfa ), 3.22, "default-bold","center") if contador == 2 then removeEventHandler("onClientRender",getRootElement(),createText) end if contador == 200 then contador = 100 movimiento = "negativo" end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Ir show me the hex color code by the player and I wont it. I hope you can help me. Regards.
  22. - isPedInVehicle - getElementHealth - getElementVelocity ... You have to multiplicate the size of the rectangle per the status of u want. Sorry for don't explain it correctly.
  23. Hey all, I would like to change dxDrawText to dxText:create I have tried it but I couldnt do it. I hope you can help me please. function mapandimagetext() local fontY = dxGetFontHeight(1.0,Racemap.font) local x = fontY/10 if not cRedo then if not Racemap.nextName then dxDrawText("Map: "..Racemap.mapName,x+2*scale,sY-x-fontY-2*scale,sX,sY*1.005-x,tocolor(0,0,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Map: #ffffff"..Racemap.mapName,x,sY-x-fontY,sX,sY*1.005-x,tocolor(255,136,0,255),1.0,"default-bold","left","center",true,true,false,true,false) else dxDrawText("Next Map: "..Racemap.nextName,x+2*scale,sY-fontY-fontY-2*scale,sX,sY*1.005-fontY,tocolor(0,0,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Next Map: #ffffff"..Racemap.nextName,x,sY-fontY-fontY,sX,sY*1.005-fontY,tocolor(255,136,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Map: "..Racemap.mapName,x+2*scale,sY-x-fontY-2*scale,sX,sY*1.005-x,tocolor(0,0,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Map: #ffffff"..Racemap.mapName,x,sY-x-fontY,sX,sY*1.005-x,tocolor(255,136,0,255),1.0,"default-bold","left","center",true,true,false,true,false) end else dxDrawText("Next Map: "..Racemap.mapName,x+2*scale,sY-fontY-fontY-2*scale,sX,sY*1.005-fontY,tocolor(0,0,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Next Map: #ffffff"..Racemap.mapName,x,sY-fontY-fontY,sX,sY*1.005-fontY,tocolor(255,136,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Map: "..Racemap.mapName,x+2*scale,sY-x-fontY-2*scale,sX,sY*1.005-x,tocolor(0,0,0,255),1.0,"default-bold","left","center",true,true,false,true,false) dxDrawText("Map: #ffffff"..Racemap.mapName,x,sY-x-fontY,sX,sY*1.005-x,tocolor(255,136,0,255),1.0,"default-bold","left","center",true,true,false,true,false) end end Thanks for all Regards.
×
×
  • Create New...