Jump to content

Hiding

Members
  • Posts

    51
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Hiding

  1. Ah, thank you for your response, I think I'll stick with the marker not being visible behind the object.
  2. Thanks for your answer, I know these thinks Let me write it down again, my question concerns how the arrow marker can be visible behind an object, the objects has 255 alpha, meaning it's not transparent, so I want my arrow marker to be visible even if there's an object front of it that obscures it.
  3. I know, my question was whether if there's an object in front of it, you can't see it, because that object obscures it. I want it to be visible even if there's an object front of it that obscures it.
  4. I would like to ask that is there any way for, let's say an arrow marker, to be visible behind another object? So that it's always visible, even if there's another object in front of it??
  5. Thank you so much, it works now
  6. I'm encountering an issue with my script where it prints 'playerName died' twice when a vehicle explodes. Interestingly, it works fine when I press enter or jump into the water; it only prints once. Any suggestions on how to handle explosions in this script? Also, any tips on optimizing the script for better efficiency would be appreciated. function onPlayerWasted(totalAmmo, killer) local playerName = getPlayerName(source) if isElement(killer) and getElementType(killer) == "player" then local killerName = getPlayerName(killer) local victimName = getPlayerName(source) if killer == source then -- suicide outputChatBox(playerName .. " died") else outputChatBox(killerName .. " killer " .. victimName) end else outputChatBox(playerName .. " died") end end addEventHandler("onPlayerWasted", root, onPlayerWasted)
  7. So first I have to apply a blink image for example?
  8. Hello, I know that in race resource there is a function called showBlipsAttachedTo(elem, bShow) from util_server.lua, and I was wondering how can I use it on client side like this? So my main goal here is to set the specific player's blip to invisible addEventHandler("setPlayerVisibility", root, function(player) local vehicle = getPedOccupiedVehicle(player) local cameraTarget = getCameraTarget() if vehicle then if cameraTarget == vehicle then ... else exports.race:showBlipsAttachedTo(vehicle, false) end end end)
  9. Hi, I want to remove every smoke from the car, engine smoke, explodion smoke, etc. My question is why just not removing the smoke? texShader = dxCreateShader ( "texreplace.fx" ) function removeSmoke() engineRemoveShaderFromWorldTexture(texShader,"collisionsmoke") engineRemoveShaderFromWorldTexture(texShader,"smoke") engineRemoveShaderFromWorldTexture(texShader,"smoke5") engineRemoveShaderFromWorldTexture(texShader,"smoke4") engineRemoveShaderFromWorldTexture(texShader,"smokeII_3") engineRemoveShaderFromWorldTexture(texShader,"fireball6") end addEventHandler("onClientResourceStart", root, removeSmoke)
  10. Hi, I want to remove every smoke from the car, engine smoke, explodion smoke, etc. My question is why just not removing the smoke? texShader = dxCreateShader ( "texreplace.fx" ) function removeSmoke() engineRemoveShaderFromWorldTexture(texShader,"collisionsmoke") engineRemoveShaderFromWorldTexture(texShader,"smoke") engineRemoveShaderFromWorldTexture(texShader,"smoke5") engineRemoveShaderFromWorldTexture(texShader,"smoke4") engineRemoveShaderFromWorldTexture(texShader,"smokeII_3") engineRemoveShaderFromWorldTexture(texShader,"fireball6") end addEventHandler("onClientResourceStart", root, removeSmoke)
  11. Hello guys, I was wondering how can I approach this: so if a player presses the f button, and if it was the source, who pressed the button then it should say "you pressed the button" otherwise "playername pressed the f button". My question is how can i get the owner of the presser? So if I press the F button then I should know that it was by me, but for others they should know that it was also me. I hope it's clear I need the the source's localPlayer on server side. (I guess) -- client side bindKey("f", "down", function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then triggerServerEvent("onPlayerToggledInvisibility", localPlayer, vehicle, localPlayer) end end) -- server side function onPlayerToggledInvisibility(vehicle, localPlayer) if vehicle then if source == localPlayer then outputChatBox("you pressed the f button") else outputChatBox(getPlayerName(source) .. "pressed the f button") end end end addEvent("onPlayerToggledInvisibility", true) addEventHandler("onPlayerToggledInvisibility", root, onPlayerToggledInvisibility)
  12. Hi, I would like to ask how can I check the player's serial on the server side and send it to the client? -- Server side function isPlayerAllowed(player) return allowedPlayers[getPlayerSerial(player)] ~= nil end -- Client side function handleKey(button, press) if not imagesEnabled and press and getKeyState("mouse2") then return false for i, allowedImage in ipairs(allowedImages) do if button == allowedImage.key then if isPlayerAllowed(localPlayer) then ... end end end end addEventHandler("onClientKey", root, handleKey)
  13. Thank you guys so much ?
  14. Thank you guys so much for trying to help me, but I guess you don't get it maybe I have to check with onClientRender when the HP reaches 0, because this onClientVehicleDamage is only triggering if damage happens, but for example when the vehicle is upside down and starts burning, it doesn't actually suffer any damage until it explodes and its life reaches zero. So what I would need is that as soon as the vehicle reaches zero hp output to the chat that "vehicle hp is 0" or something. But if I check it with onClientRender then it will flood the chat until my hp is 0, how can I manage to write once in the chat if the hp is reaching 0?
  15. I tried with onClientVehicleDamage, but it only triggered when my car was exploded. I need the localPlayer vehicle's health before the explosion.
  16. Hello, my question is how to detect if my vehicle's health is reaching 0? if so then write in the chat that "your vehicle's HP is 0".
  17. Thank you so much, it works perfectly now
  18. Thank you for your response. This is the server side now: addEventHandler("onResourceStart", resourceRoot, function() local players = getElementsByType("player") for i, player in ipairs(players) do local country = exports.admin:getPlayerCountry(player) triggerClientEvent(player, "onPlayerCountryReceived", resourceRoot, country) end end) And this is the client side: local myCountry = "" addEvent("onPlayerCountryReceived", true) addEventHandler("onPlayerCountryReceived", resourceRoot, function(country) myCountry = country end) But it says that server triggered client side event onPlayerCountryReceived, but event is not added client side.. wtf?
  19. De van lua nyelv is local factionMarkers = {} addEventHandler("onClientElementDataChange",resourceRoot,function(key,old,new) if key == "char:factionid" then if new == 1 then factionMarkers["police"] = createMarker() elseif old == 1 then destroyElement(factionMarkers["police") end end end)
  20. Hello, I'm trying to get the player's country from admin panel, and use that country in client side, but I always get the error msg: failed to call: 'admin:getPlayerCountry' [string"?"] Admin is running ofc. -- SERVER addEventHandler("onResourceStart", resourceRoot, function() local player = source local country = exports.admin:getPlayerCountry(player) triggerClientEvent(player, "onPlayerCountryReceived", player, country) end) -- CLIENT local myCountry = "" function onPlayerCountryReceived(country) myCountry = country end addEvent("onPlayerCountryReceived", true) addEventHandler("onPlayerCountryReceived", localPlayer, onPlayerCountryReceived)
  21. Thank you guys so much, I already get it ?
×
×
  • Create New...