All Activity

This stream auto-updates     

  1. Past hour
  2. [Question] Reduce the damage

    @Awang Thank you, Your way is the one i need exactly. @ShayF Thanks for your help, But i guess your code have some issues I remember i used this way once, And i noticed some problems in it like your hp reloaded automatically sometimes when you get hit by another player specially if the other player have a lag or something, or also you.
  3. يا أخي حطيت الكود و في تكرار بالله شوف حل
  4. скорее проблема в том, что нормальной рекламы у дейз серверов почему то нет ну или я просто не видел. так что взяв рекламу на каналах хотя бы от 1000 просмотров на видео (не одно видео, а серию из нескольких) то без труда можно набрать до 100 онлайна в первое время, а вот потом либо дальше покупать рекламу либо чем то действительно заинтересовать игроков.
  5. Teams and markers

    Thanks guys
  6. Today
  7. شباب .. احنا شغالين في المقر وابجكتات .. * لكن السيرفر باذن بالله هيكون مختلف عن الاخرين .. لكن دعواتكم بس ..
  8. [Help] Instantaneously stop player from running & Knockback

    You can use setPedAnimation but you need the correct anim.
  9. Teams and markers

    Or in clientside: addEventHandler("onClientMarkerHit",theMarker,function(hitPlayer, matchingDimension) if matchingDimension and hitPlayer == localPlayer then if getPlayerTeam(localPlayer) == team1 then outputChatbox("You are in team 1") elseif getPlayerTeam(localPlayer) == team2 then outputChatbox("You are in team 2") elseif getPlayerTeam(localPlayer) == false then outputChatbox("You are not member of any team") end end end)
  10. Teams and markers

    local marker = createMarker ( x, y , z, "cylinder", 1.5, 255, 255, 0, 170 ) function team(player) local pt = getPlayerTeam( player ) if (pt) then outputChatBox(player, "You are in team") else outputChatBox(player, "You need a team") end end addEventHandler("onMarkerHit", marker, team)
  11. Hi there! Recently I have this problem with knockbacking the victim and instantaneosly stop the victim from walking/running. 1. I tried using spawnPlayer with current coordinates and position, but for a second it can be seen that once spawned it turns smoothly from 0 to 90 degrees. I wonder if there's an alternative for this: function cancelrun ( attacker, weapon, bodypart, loss ) if attacker ~= nil then if isPedOnGround(source) then local x,y,z = getElementPosition(source) local r = getElementRotation(source) local skin = getElementModel(source) local h = getElementHealth(source) spawnPlayer(source, x,y,z,r) setElementModel(source, skin) setElementHealth(source, h) end end end addEventHandler ( "onPlayerDamage", getRootElement(), cancelrun ) 2. With 'knockback' I mean if the victim is getting damage I want him to be pushed back. An example might be very helpful. Thanks!
  12. Teams and markers

    Hi, I want to create a simple event with a check I wrote down two local variables that create a team In the spawn function of the player specified setPlayerTeam If the player hit the marker, then a message is shown in the chat, if, of course, he is in this team Also I tried this function getPlayerTeam But as far as I understand it is not required here, I hope I'm not mistaken Well, I'm hoping for your help.
  13. [REL] Misterix Mod V1

    Thx for the downloads <3
  14. [Question] Reduce the damage

    Thank you, I'm on a phone and a bit busy, hard to type or even thing of reasonable math. So thank you for fixing my code.
  15. [Question] Reduce the damage

    You shuld check this by matematically... For example, the loss is 10, 10/50 will not the 50% of 10.... if you really want to do with percent parameter, you need to use like this: local reductionPercent = 50 addEventHandler('onClientPlayerDamage',root,function(attacker,weapon,bodypart,loss) if loss then local health = getElementHealth(localplayer) setElementHealth(localplayer,health+(loss*(reductionPercent/100)) end end) Still I think, cancel the root damage and recalculate it will be the simpliest way to understand how this event work... Even the question was reduce the damage for a specific player, not for everbody... With elementData you can change it real time in the server, like an admin can take this ability or give it to a player by using setElementData()
  16. Both good points, but this was example code I typed quickly to show how I was trying to pass the PLAYER as an argument to server side, I will put actual code below, just made example because it's easier to read... In the script the marker is server side, as well as the vehicle spawning, change teams, and checks for element data. Server side is just GUI, sorry for the confusion with the bad example. Client Only need first 2 functions, third just shows you what I want to do if they click no. function spawnTheTruck() local screenW, screenH = guiGetScreenSize() window = guiCreateWindow((screenW - 312) / 2, (screenH - 104) / 2, 312, 104, "Spawn a truck or use your own?", false) guiWindowSetSizable(window, false) showCursor(true) label1 = guiCreateLabel(56, 27, 201, 17, "Yes - Spawn a truck.", false, window) label2 = guiCreateLabel(56, 40, 201, 17, "No - I brought my own.", false, window) guiLabelSetHorizontalAlign ( label1, "center") guiLabelSetHorizontalAlign ( label2, "center") Yes_btn = guiCreateButton(56, 64, 89, 30, "Yes", false, window) No_btn = guiCreateButton(168, 65, 89, 29, "No", false, window) addEventHandler("onClientGUIClick", Yes_btn, spawnYes) addEventHandler("onClientGUIClick", No_btn, spawnNo) end addEvent("spawnTruck", true) addEventHandler("spawnTruck", getRootElement(), spawnTheTruck) function spawnYes(button, state, hitElement) if source == Yes_btn and button == "left" and state == "up" then triggerServerEvent("spawnTruckYes", localPlayer, hitElement) destroyElement(window) showCursor(false) end end function spawnNo(button, state) if source == No_btn and button == "left" and state == "up" then --triggerServerEvent("spawnTruckNo", localPlayer, this) destroyElement(window) showCursor(false) end end Server Only need first 3 functions, last one is just there to show how markers are made. local markerStore = {} --Stores markers function TruckerStart ( hitElement, matchingDimension ) if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if not (isGuestAccount (getPlayerAccount (hitElement))) then local account = getPlayerAccount (hitElement) if (account) then local PlayerShipments = getAccountData( account, "Trucker.pres" ) if (PlayerShipments) then setElementData (hitElement, "Trucker.pres", PlayerShipments) else setElementData (hitElement, "Trucker.pres", 0) end triggerClientEvent ( hitElement, "spawnTruck", hitElement) end end end end function spawnNo(hitElement) --If player choses no in client side GUI, then they won't get a truck if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if ( TruckerTeam ) then if isPedOnGround ( hitElement ) then local playerTeam = getPlayerTeam ( hitElement ) if not ( playerTeam == TruckerTeam) then setPlayerTeam(hitElement, TruckerTeam) end --[[triggerClientEvent ( hitElement, "destroyIron", hitElement)<<Custom handler for iron miner script]] triggerClientEvent ( hitElement, "shipmentMarker", hitElement) else outputChatBox("You must be on foot!", hitElement, 255, 0, 0) end end end end addEvent("spawnTruckNo", true) addEventHandler("spawnTruckNo", getRootElement(), spawnNo) function spawnYes(hitElement)--If player choses yes in client side GUI, then they will get a truck if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if ( TruckerTeam ) then if isPedOnGround ( hitElement ) then local playerTeam = getPlayerTeam ( hitElement ) if not ( playerTeam == TruckerTeam) then setPlayerTeam(hitElement, TruckerTeam) end local spawnedTruck = getElementData( hitElement, "Trucker.truck" ) --Check if player has spawned a truck if ( spawnedTruck ~= false ) then destroyElement(spawnedTruck) --If they have, destroy the truck spawnedTruck = nil setElementData(hitElement, "Trucker.truck", false) --And set there data to false else triggerClientEvent ( hitElement, "destroyIron", hitElement) triggerClientEvent ( hitElement, "shipmentMarker", hitElement) local x, y, z, rx, ry, rz, name local marker_data = markerStore[source] if marker_data then x,y,z,rx,ry,rz,name = marker_data[4],marker_data[5],marker_data[6],marker_data[7],marker_data[8],marker_data[9],marker_data[10] local Truck = createVehicle (515, x, y, z+1, rx, ry, rz) setElementData(hitElement, "Trucker.truck", Truck) warpPedIntoVehicle (hitElement, Truck) end end else outputChatBox("You must be on foot!", hitElement, 255, 0, 0) end end end end addEvent("spawnTruckYes", true) addEventHandler("spawnTruckYes", getRootElement(), spawnYes) function createMarkers() for i=1,#TruckerMarker do local x,y,z = TruckerMarker[i][1],TruckerMarker[i][2],TruckerMarker[i][3] local marker = createMarker( x,y,z,"cylinder", 1, 0, 200, 55, 255 ) markerStore[marker] = TruckerMarker[i] TruckerJobBlip = createBlipAttachedTo ( marker, 42, 2, 0, 0, 0, 0, 0, 500 ) addEventHandler("onMarkerHit", marker, TruckerStart) end end createMarkers() Hope this helps you understand what I'm trying to accomplish...
  17. [Question] Reduce the damage

    local reductionPercent = '50' addEventHandler('onClientPlayerDamage',root,function(attacker,weapon,bodypart,loss) if loss then local health = getElementHealth(localplayer) setElementHealth(localplayer,health+(loss/reductionPercent)) end end) Something like this. No offense, I was using a phone to type this, so code might look wonky..
  18. موفق اخويً بس الي جالس اشوفهه كلها ابجكتات م اشوف شي جديدً واعتقد الدبابة والبرج وغيرها منشورين نبي نشوف شي جديد فكرة جديدة غير عن انك تقتل زومبي ويجيك اكس بي وفلوس كالباقي والمقصد تقوية للموضوع والسيرفر وليس استنقاص منك , الي في قلبي ع لساني - وانا جالس اشتغل على شي جديد ان شاء الله انه ينجح بقولك فكرته باختصار شبيه من التكتيك يصير تصويت على ماب ويخشون فرقة بشر وفرقة زومبي الزومبي لو يبقسو البشر راح يتحول البشري معهم زومبي , والبشري لو قتل زومبي راح تجيه شخصية غير وتجيه اسلحة غير ولفل ومن ذي الأشياء طبعا اشتغلت عليه 30% بالمية فقط . وبالتوفيق <3
  19. [RESOLVED] triggerServerEvent

    In what situation would it not detect it? I can't think of a single case where it happens.
  20. [Question] Reduce the damage

    Or if you add a specific elementData, you can write something like this: addEventHandler("onClientPlayerDamage",root,function(attacker, weapon, bodypart,loss) if source == localPlayer and getElementData(localPlayer,"less.damage") == true then cancelEvent() setElementHealt(localPlayer,getElementHealt(localPlayer)-loss*0.8) end end) For the player, who have the elementData will only get the 80% of the real damage.
  21. موفق اخي , باين عليك محترف تصميم ضض
  22. [ Open World War Server .. Soon ]

    موفق و ان شاءالله نشوفه من افضل السيرفرات
  23. [Question] Reduce the damage

    You can use this https://community.multitheftauto.com/index.php?p=resources&s=details&id=5195 ( from castillo, Solidsnake14 ). that don´t going to reduce the damage but gives extra health to the player ( it would be the closest thing because going to give a effect like reducing damage ) .
  24. [Question] Reduce the damage

    this is for vehicles .. only i meant for the player to reduce the damage of the player
  25. طلب كود

    getVehicleController
  26. [RESOLVED] triggerServerEvent

    No problem = )
  27. [RESOLVED] triggerServerEvent

    OK I will do it. Thank you bro!
  1. Load more activity