Jump to content

Rolplay

Members
  • Posts

    41
  • Joined

  • Last visited

Recent Profile Visitors

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

Rolplay's Achievements

Rat

Rat (9/54)

2

Reputation

  1. Hi! I found this api a few days ago by @botder. I downloaded Docker Desktop and change directory in powershell to webradio's folder, typing in the api key and start it, but it isn't work. Someone can help me to setup this api fine? https://github.com/botder/mtasa-webradio Thanks!
  2. I don't really unrestand what should i do. Just copy those 2 php codes to a html file or what?
  3. Hi! I want to make a youtube radio to my server. I don't want to use browser, just playSound3D. Does anyone have any experience? I know i have to use API for convert, but i don't really know other languages than lua. Ty for reply.
  4. Hi! I want to know, it is possible to calculate horsepower in mta:sa? I want to make a hp based tuning-system, and thats an important part. How can i do it?
  5. Hi! I use @Ren_712's object-viewer resource for my cars, and i have a problem with using shaders. I want to apply a light shader to the car, which turns on only the vehiclelights128 texture without the lights. Here is my shader: #include "mta-helper.fx" float gMultiplier = 0; sampler Sampler0 = sampler_state { Texture = (gTexture0); MinFilter = Linear; MagFilter = Linear; }; struct VSInput { float3 Position : POSITION0; float2 TexCoord : TEXCOORD0; }; struct PSInput { float4 Position : POSITION0; float2 TexCoord : TEXCOORD0; }; PSInput VertexShaderFunction(VSInput VS) { PSInput PS = (PSInput)0; PS.Position = MTACalcScreenPosition ( VS.Position ); PS.TexCoord = VS.TexCoord; return PS; } float4 PixelShaderFunction(PSInput PS) : COLOR0 { float4 color = tex2D(Sampler0, PS.TexCoord); color = color*gMultiplier; return color; } technique tec0 { pass P0 { VertexShader = compile vs_2_0 VertexShaderFunction(); PixelShader = compile ps_2_0 PixelShaderFunction(); } } And here is my client script, which turn on the light. local animShads = {} local lights = 0 function updateLights(myElementRT2) if lights == 0 then setVehicleOverrideLights( myElementRT2, 1 ) if animShads[myElementRT2] then destroyElement(animShads[myElementRT2][1]) animShads[myElementRT2] = nil end elseif lights == 1 then local shad = dxCreateShader("shader2.fx") animShads[myElementRT2] = {shad,0} iprint(animShads) engineApplyShaderToWorldTexture( shad, tex_reverse, myElementRT2) end end local last = 0 function updateMultipliers() local cur = getTickCount()-last last = getTickCount() for k,v in pairs(animShads) do --iprint(v[2]) v[2] = v[2] + cur/1000 dxSetShaderValue(v[1],"gMultiplier",v[2]) if v[2] >= 1 then destroyElement(v[1]) setVehicleOverrideLights(k, 2 ) setVehicleHeadLightColor(k,0,0,0) animShads[k] = nil --setVehicleHeadLightColor(veh,0,0,0) end end end addEventHandler("onClientRender",root,updateMultipliers) if myElement then if lights == 0 then lights = 1 elseif lights == 1 then lights = 0 else lights = 0 end local myElementRT = exports.object_preview:getRenderTarget() iprint(myElementRT) updateLights(myElementRT) end end PS.: I think this is not the script's fault because its work fine with normal cars which spawned on world.
  6. Hi+! I want to make diesel smoke from the exhaust but i don't know how. I already made a script which replaces the smoke texture, but that is not perfect , because the game uses the def. Smoke texture for the exhaust and the wheel smoke, so if is change the exhaust smoke to black, the wheel smoke changes too.
  7. 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
  8. I think, the car separate is too hard for me, i never heard about tables so its very hard for now
  9. 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.
  10. 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 = false; info.indicator_right_on = false; info.indicator.right_start = false; info.vehicle = vehicle; vehicle_indicator_lights[vehicle] = info; return info; end local function vehicle_left_down() seat = getPedOccupiedVehicleSeat(localPlayer) if seat then if seat and seat==0 then triggerServerEvent("onVehicleTurnOnIndicator", root, "left") end if (info.indicator_left_on == true) then triggerServerEvent("onVehicleTurnOffIndicator", root, "left") end end end bindKey("mouse1", "down", vehicle_left_down) function destroy() if (getElementType(source) == "vehicle") then if (vehicle_indicator_lights[vehicle] == true) then engineRemoveShaderToWorldTexture(shader_right, "p", n) engineRemoveShaderToWorldTexture(shader_left, "l", n) vehicle_indicator_lights[source] = nil; end end end addEventHandler("onClientElementDestroy", root, destroy ) function left_indicator() local now = getTickCount(); for _,info in pairs(vehicle_indicator_lights) do local vehicle = info.vehicle; if (indicator_left_on) then local passed_time_ms = now - info.indicator_left_start; local period = 1 - math.floor(( passed_time_ms / indicator_blink_duration_ms ) % 2); dxSetShaderValue(shader_left, "intensity", 1); if (period == 0) then dxSetShaderValue(shader_left, "intensity", 0); end end end -- TODO: add the same for the right indicator. end addEventHandler("onClientRender", root, left_indicator) addEvent("onClientVehicleTurnOnIndicator", true); addEventHandler("onClientVehicleTurnOnIndicator", root, function(left_indicator) if (left_indicator == "left") then info.indicator_left_on = true; info.indicator_left_start = getTickCount(); end end ); addEvent("onClientVehicleTurnOffIndicator", true); addEventHandler("onClientVehicleTurnOffIndicator", root, function(left_indicator) if (left_indicator == "left") then dxSetShaderValue(shader_left, "intensity", 0); info.indicator_left_on = false; end end );
  11. 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.
  12. 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
  13. EDIT: We tested it again, and its visible, but only visible for other car drivers and passengers.
  14. So i tested the client-server communication with my friend, but he dont see the indicator. Only works on client side, why?
×
×
  • Create New...