Jump to content

Rolplay

Members
  • Content Count

    34
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Rolplay

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi! I just started to make a hud-system, but i can't resume my system, because i'dont know, how to make this: I have a stickman png, and i want to make an injury system.I want to make if the player hits a car, jump from high ground etc... the player break their bones, and it's visible on the stickman, and the player can't kick, punch shoot etc. What functions i need to use? Ty all
  2. I think, the car separate is too hard for me, i never heard about tables so its very hard for now
  3. Thank you, i try to make that. While i was working, i found a bug. The script changing the texture when the indicator turned on, but if it was off, there are a black texture. In small indicators that is indiscernible but in bigger indicators it is very "ugly". U can see, if the script is'nt running, there is the texture, but if i start the script that going to black.
  4. So hi again! I try to make the separatem but i cant do perfect. This is the left side: local indicator_blink_duration_ms = 333; -- time in milliseconds that the indicator should blink. local vehicle_indicator_lights = { engineApplyShaderToWorldTexture(shader_right, "p", n); engineApplyShaderToWorldTexture(shader_left, "l", n); }; local function getVehicleIndicatorLights(vehicle) if (vehicle_indicator_lights[vehicle]) then return vehicle_indicator_lights[vehicle]; end local info = {}; info.indicator_left_on = false; info.indicator_left_start = fals
  5. Thank you, i made it The last part is the separate +1: can you help me edit the shader, for fade in and fade out effect? Is that possible? I mean the texture appears smooth.
  6. I found the bug, i have a line what i made for debug a bug. Without this if i left the car, and dont release the key button, the indicator is working. seat = getPedOccupiedVehicleSeat(localPlayer) if seat then So my idea is this: Turn on with mouse click and turn off with click again. Can u give me a function for this? And now, i try to make the car indicator logic separated
  7. EDIT: We tested it again, and its visible, but only visible for other car drivers and passengers.
  8. So i tested the client-server communication with my friend, but he dont see the indicator. Only works on client side, why?
  9. I dont really understand what i need to do,so i updated my indicator_left and indicator_right code with this: addEventHandler("onClientRender", root, function() for _,info in pairs(vehicle_indicator_lights) do local vehicle = info.vehicle; -- TODO: update the left and right vehicle indicator light shaders. end end end ); And this is what i got: function left_indicator() local now = getTickCount(); seat = getPedOccupiedVehicleSeat(localPlayer) for _,info in pairs(vehicle_indicator_lights) do local vehicle = info.vehicle; if
  10. local indicator_blink_duration_ms = 333; -- time in milliseconds that the indicator should blink. local indicator_left_on = false; -- is the left indicator on? local indicator_left_start; local indicator_right_on = false; local indicator_right_start; local function vehicle_left_down() triggerServerEvent("onVehicleTurnOnIndicator", root, "left") end bindKey("mouse1", "down", vehicle_left_down) local function vehicle_left_up() triggerServerEvent("onVehicleTurnOffIndicator", root, "left") end bindKey("mouse1", "up", vehicle_left_up) function left_indicator() local now = getT
  11. So, the syncing is technically finished, right? I dont know, because i'm waiting my friend to check. For now, please can you help me in "how to allow indicator lights for each vehicle separately?" +1 local enabledVehicleMod = {} addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () for index, value in ipairs (elements) do if tostring(index) ~= tostring(value) then changeVehicleMod (value[1], value[2]) end end for i=1 , 10000 do if not enabledVehicleMod[i] then enabledVehicleM
  12. I need to complete my original onclientrender with this, or i need to write an another? addEventHandler("onClientRender", root, function() local now = getTickCount(); if (indicator_right_on) then local passed_time_ms = now - indicator_right_start; local period = 1 - math.floor(( passed_time_ms / indicator_blink_duration_ms ) % 2); dxSetShaderValue(shader_right, "intensity", period); end -- TODO: add the same for the left indicator. end );
  13. Ohh, i think i understand but not 100% from this Server: addEvent("onVehicleTurnOnIndicator", true); addEventHandler("onVehicleTurnOnIndicator", root, function(right_indicator) local vehicle = getPedOccupiedVehicle (client) if vehicle then triggerClientEvent ( "onClientVehicleTurnOnIndicator", vehicle, right_indicator) end end ); addEvent("onVehicleTurnOffIndicator", true); addEventHandler("onVehicleTurnOffIndicator", root, function(right_indicator) local vehicle = getPedOccupiedVehicle (client) if vehicle then triggerClientE
  14. I found a lot of mistakes, and i recreate, this is my script now: Server-side of right indicator: addEvent("onVehicleTurnOnIndicator", true); addEventHandler("onVehicleTurnOnIndicator", root, function(right_indicator) local vehicle = getPedOccupiedVehicle (client) if vehicle then triggerClientEvent ( "onClientVehicleTurnOnIndicator", vehicle, right_indicator) end end ); addEvent("onVehicleTurnOffIndicator", true); addEventHandler("onVehicleTurnOffIndicator", root, function(right_indicator) local vehicle = getPedOccupiedVehicle (client)
  15. Ohh, thank you! I try to understand that. I copied the server-side from here, and make this on client side: function right_indicator() local now = getTickCount(); seat = getPedOccupiedVehicleSeat(localPlayer) if (indicator_right_on) then local passed_time_ms =-- local period = -- local vehicle = -- if vehicle then dxSetShaderValue(shader_right, "intensity", 1,vehicle); triggerServerEvent("onVehicleTurnOnIndicator", root,right_indicator) end if (period == 0) then dxSetShaderValue(shader_right, "intensity", 0,vehicle); triggerS
×
×
  • Create New...