Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/02/21 in Posts

  1. Oh yes forgot server side onDamage can’t be canceled!
    2 points
  2. You probably did it correctly, the only problem is that this event cannot be cancelled. Since the damage has already happened on clientside a while(few milliseconds) ago. This event represents a reflection of the past, not the moment the player got damaged. The now moment: onClientPlayerDamage
    2 points
  3. yes, i didn't see his comment before I replied, thanks y'all @IIYAMA error is : line 6: = expected near getPedArmor() it gives an error even though I put the = , and <= 0 means if less than 0 right? addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then If getPedArmor(source) <= 0 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then setElementHealth(source, getElementHealth(source)-20) if weapon == 34 then setElementHealth(source, getElementHealth(source)-100) end end end end ) check my edit: @IIYAMA @Tekken
    1 point
  4. Yes, @Tekken just gave you that one a few seconds ago.
    1 point
  5. If getPedArmor(source) > 0 then When in doubt always check wiki GetPedArmor returns a float that can be from 0 to 100 of i recall correctly
    1 point
  6. A little example local sx, sy = guiGetScreenSize(); local scaleX,scaleY = 1920/sx, 1080/sy; -- replace 1920 and 1080 with your resolution! function draw() -- Let's say we want to create a button on the right side 20px away from the screen at 150px from the bottom; local xpos = 20*scaleX; local ypos = 150*scaleY; local text = "PRESS ME!"; local tx, ty = dxGetTextSize(text, 0, 1, 1, Roboto, true); dxDrawText(text, sx-tx-xpos, sy-ty-ypos, sx-xpos, sy-ypos, tocolor(255,255,255,255), 1, Roboto, "center", "center", false, false, false, true); end addEventHandler("onClientRender", root, draw); Take a look at this tutorial: Hope that helped you!
    1 point
×
×
  • Create New...