Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 14/01/18 in all areas

  1. لايك وسب سكرايب
    3 points
  2. 1 point
  3. نظام حرب كامل مختلف عن باقي السيرفرات
    1 point
  4. The client event is triggered for all clients you'd have to add a check as well then. Put the code on the client side as well as the marker and use the onClientMarkerHit event. The event's callback returns 2 arguments, the element that hit the marker and the matching dimension. Ignore the latter for now. Example: local mark = createMarker(0, 0, 4, "arrow", 1) function onHit(element) if (element == localPlayer) then -- check if the element is the localPlayer (you) outputChatBox("hit") end end addEventHandler("onClientMarkerHit", mark, onHit) Hope this helps
    1 point
  5. Are you sure that "asdasd" data is false when you try to delete the timers? otherwise it will just create more timers in place of old ones.
    1 point
  6. 1 point
  7. شرح رائع من شخص اروع اكيد مشكور اخي ماستر و بتوفيق في سلسة الشرح
    1 point
  8. local friends = { ["Emergency"] = true, } function onStart () for index, theTeam in ipairs(friends) do if (getTeamFriendlyFire(getTeamFromName(theTeam)) == false) then setTeamFriendlyFire(getTeamFromName(theTeam),true) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart) setTeamFriendlyFire and getTeamFriendlyFire wants team, not team name. So u need to use getTeamFromName. And also you should call this function in onResourceStart --- function onStart () for i = 0,46 do setWeaponProperty(i,"poor","damage",getOriginalWeaponProperty(i,"poor","damage")) setWeaponProperty(i,"std","damage",getOriginalWeaponProperty(i,"std" "damage")) setWeaponProperty(i,"pro","damage",getOriginalWeaponProperty(i,"pro","damage")) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart) This code will revert all weapons damages to original.
    1 point
  9. الداتا ما بتنفعك لو تبي تحفظ كمية المعدن انصحك بال sql or acc data
    1 point
  10. try this am didn't test it really but try it local sw, sh = guiGetScreenSize() local fps = getPlayerPing(getLocalPlayer()) ColumnName = {{ name = "", width = 100, data = function (element) return getPlayerName ( element) end },} ColumnStats = { { name = "Murders", width = 100, data = function (element) return ( getElementData ( element, "murders" ) or 0 ) end }, { name = "Zombies", width = 100, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ) end }, { name = "Alive", width = 100, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end }, { name = "Ping", width = 80, data = function (element) return getPlayerPing ( element, "ping" ) or 99 end }, { name = "Country", width = 100, data = function (element) return getElementData ( element, "Country" ) or 'N/A' end }, { name = "Flag", width = 100, data = function (element) return getElementData ( element, "countryFlagImage" ) or 'N/A' end }, { name = "Group", width = 100, data = function (element) return getElementData ( element, "Group" ) or "None" end }, } local serverName = "Server" local topsize = 60 local playersize = topsize-30 local panelsize = playersize*1 function calculateWidth() local width = 0 for key, value in ipairs( ColumnName ) do width = width + value.width end for key, value in ipairs( ColumnStats ) do width = width + value.width end return width + 60 end local max_players = 50 local ploff = 0 local width = calculateWidth() local baseX = sw/2-width/2 local baseY = sh/2-(panelsize+topsize)/0.5 addEventHandler( "onClientRender", root, function() if getKeyState( "tab" ) == false then ploff = 0; return end if getElementData(getLocalPlayer(),"logedin") then dxDrawRectangle ( baseX, baseY-40, width, topsize+10, tocolor(0, 0, 0, 80) ) dxDrawRectangle ( baseX, baseY-40, width, topsize+40, tocolor(0, 0, 0, 40) ) dxDrawText ( serverName, baseX+53, baseY-45, baseX+width, baseY+topsize, tocolor(255,255,255,60), 2.6, "bankgothic" ) dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0, 0, 0, 40) ) dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(100,100,100,50),0.8 ) local xoff = 60 for i, v in ipairs ( ColumnName ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+70, baseX+xoff+v.width+10, baseY+topsize-30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end for i, v in ipairs ( ColumnStats ) do dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize, tocolor(100,100,100),0.9 ) dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) xoff = xoff+v.width end local playersTable = getElementsByType ( "player" ) dxDrawText ( "Players: "..tostring(#playersTable).."/"..tostring(max_players), baseX -550, baseY+60, baseX+width, baseY+30, tocolor(255,255,255,255), 1, "default-bold", "center", "center" ) local maxNum = #playersTable if maxNum > 10 then maxNum = 10 end for i = 1, maxNum do dxDrawLine ( baseX, baseY+topsize+playersize*i, baseX+width, baseY+topsize+playersize*i, tocolor(0, 0, 0, 40),0.5 ) dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1), baseX+25, baseY+topsize+playersize*i, tocolor(255, 255, 255,255), 1, "default-bold", "center", "center" ) if playersTable[i+ploff] == localPlayer then dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(0, 0, 0, 60) ) else dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1), width, playersize, tocolor(0, 0, 0, 30) ) end local xoff = 60 for c, d in ipairs ( ColumnName ) do local data = d.data(playersTable[i+ploff]) --local r,g,b = 255,255,255,50 dxDrawText ( data, baseX+xoff-40, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-10, baseY+topsize+playersize*i, tocolor(255, 255, 255,255), 0.9, "default-bold", "center", "center" ) xoff = xoff+d.width end for c, d in ipairs ( ColumnStats ) do local data = d.data(playersTable[i+ploff]) local r,g,b = 255, 255, 255,255 if d.name == "Group" and data == "None" then r,g,b = 249,41,0 data = "None" end if d.name~='Flag' then dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-5, baseY+topsize+playersize*i, tocolor(r,g,b), 0.9, "default-bold", "center", "center" ) else if data~='??' then dxDrawImage ( baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-5, baseY+topsize+playersize*i, data ) else dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1), baseX+xoff+d.width-5, baseY+topsize+playersize*i, tocolor(r,g,b), 0.9, "default-bold", "center", "center" ) end end xoff = xoff+d.width end end end end ) function PlayerScrollMenu (key,keyState,arg) if getElementData(localPlayer,"logedin") and getKeyState( "F4" ) then if ( keyState == "down" ) then if arg == "up" then if ploff > 0 then ploff=ploff-1 end elseif arg == "down" then local playersTable = getElementsByType ( "player" ) if ploff < #playersTable-10 then ploff = ploff+1 end end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" ) function formatTimeFromMinutes(value) if value then local hours = math.floor(value/60) local minutes = math.round(((value/60) - math.floor(value/60))*100/(100/60)) if hours then if hours == 0 then value = minutes.." min" end elseif hours >= 1 then value = hours.." ч "..minutes.." min" end return value end return false end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function sendMaxPlayersOnServer (players) max_players = players end addEvent("sendMaxPlayersOnServer",true) addEventHandler("sendMaxPlayersOnServer",getLocalPlayer(),sendMaxPlayersOnServer) ============================================ countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="Slovakia", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } function OnResourceStart() local tPlayers = getElementsByType('player') for _,uPlayer in ipairs(tPlayers) do local countryCode = exports["admin"]:getPlayerCountry(uPlayer) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData(uPlayer, "countryFlagImage", sFlagImagePath ) else setElementData(uPlayer, "countryFlagImage", "??" ) end end setElementData(uPlayer, "Country", name ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), OnResourceStart)
    1 point
  11. local markers = {} function addMarker(x,y,z,type,size,r,g,b,a,visible) local self = {} self.x = x or 0 self.y = y or 0 self.z = z or 0 self.type = type or 'checkpoint' self.size = size or 1 self.r = r or 0 self.g = g or 0 self.b = b or 0 self.a = a or 255 self.visible = visible or root table.insert(markers,self) return self end function startMarkers() for i=1,#markers do local m = markers[i] if m.marker then if isElement(m.marker) then destroyElement(m.marker) end end m.marker = createMarker(m.x,m.y,m.z,m.type,m.size,m.r,m.g,m.b,m.a,m.visible) end end local marker1 = addMarker(0,0,0,'cylinder',1,0,255,255,root) startMarkers() Maybe this script isn't what you wanted, however it allows you to store markers in a table without triggering them. It allows you to trigger them whenever you want. That way you could do what you want with the table, you know adding positions, but this way you're adding the entire marker. And then creating it whenever you want. I hope you find this helpful, have a nice day. Here is what you were looking for, I hope you have a nice day. local positions = { {x=0,y=0,z=0}, {x=1,y=1,z=1},-- use whatever positions u want {x=2,y=2,z=2} } function marker(type,size,r,g,b,a,visible) local type = type or 'cylinder' local size = size or 1 local r,g,b,a = r,g,b,a or 255,255,255,255 local visible = visible or root local pos = positions[math.random(1,#positions)] return createMarker(pos.x,pos.y,pos.z,type,size,r,g,b,a,visible) end local mark = marker()-- this allows u to not put values in if u dont want to. Also this may help you for future scripts. function getRandomFromTable(tab) if tab and tab[2] then local rand = math.random(1,#tab) return tab[rand] end end local pos = getRandomFromTable(positions)
    1 point
  12. i can sell you full pubg gamemode which has all needed features to function correctly, including this hud too. PM me for more info or add me on skype reals12.
    1 point
  13. rx,ry,rz are not declared. run it all serverside and use local rx,ry,rz = getElementRotation(player) for those values.
    1 point
  14. Because the vehicle doesn't exist on the client, at least not the variable. Place the 2 functions on the server side in your function under createVehicle.
    1 point
×
×
  • Create New...