Leaderboard
Popular Content
Showing content with the highest reputation on 19/12/17 in all areas
-
Sry everyone, I am so busy with my study these days. This project will slow down for several days. But I promise, when I came back, it will be a big update ( DGS Version 3.0 ) with a lot of new properties and functions.3 points
-
2 points
-
"onClientGUIClick" triggerServerEvent --Server addEvent setElementData -- true getElementData -- if true then setTimer if isElementInWater getElementType killPed --- "onMarkerHit" or "onPlayerMarkerHit" getElementType -- "player" givePlayerMoney getElementsInDimension -- Useful function setElementData -- false killPed اضغط مشان تخش علي رابط اليوزفل حق getElementsInDimension2 points
-
السلام عليكم حبيت احط لكم وظيفه مفيده شوي هي انطرحت من قبل بس اشوف ان الي طرحوها عندهم شويه اشياء ناقصه مثلا اول كود ملاحظ انو مسوي هيك if string == "true" then return true else return false end false راح ترجع "hello" هيك مثلا لو كان السترنج هيك ----- و الكود التاني حق دابل مثلا لو السترنج FALSE OR TRUE هيرجع nil لهيك حبيت اختصرها شوي و اظبطها للي يحتاجونها ----------------------------------------- function name : tobool args. : string ex : tobool("FaLsE") source Code : function tobool(str) if not str and type(str) ~= "string" then error("ERROR : function tobool bad argument #1 expected string ( got "..type(str).." )") return end str = str:lower() if str == "true" then return true elseif str == "false" then return false else return nil end end2 points
-
نظام القائمة السوداءالعربي المقترح لكم هو نظام يمكننا فيه حظر الأشخاص أو الخوادم الذين أسائو لأكثر من سيرفرين عربيين با التخرييب , التهكير , سرقة المودات , التقليد المباشر ,محاولة اساءة السمعة , تحريض الأشخاص حيث بإمكان أي خادم متضرر و عضو في هذا النظام تقديم شكوى على أشخاص او خوادم قامو بهذه الأشياء ليتم حظرهم في كل سيرفر عضو بهذا النظام وينتج عن هاذا تقليل المشاكل التي تصير حاليا بالساحة العربية منها : سرقة المودات وتهكير بعض الخوادم وتقليد الخوادم لبعضها البعض وتأمين العمل الراقي و الإتحاد مابين السيرفرات من أجل التطور والرقي أيش الحل مع الأطفال الي يدخلون سيرفراتنا و يستغلون ثغرات عشاان يخربون سيرفري المتعوب عليه؟ أيش الحل مع الأطفال الي من الصبح لليل ما يوقف ددوس لأنه حاقد علي ؟ أيش الحل مع يسرق مودي الي سهران عليه و تعبان عشان أبرمجه و احطه في سيرفري حصرياً او ابيعه للناس؟ الحل هو نظام بلاك ليست العربي. حالياً يوجد 16 خادم عربي منضم لهذا الأتحاد الي بالصراحة بيساعد جميع الخوادم العربية. :معلومات مهمة حاليا الإتحاد يشمل خوادم الرول بلاي فقط ونحن نسعى لتعميمه ليشمل بعض أنواع اللعب الأخرى حتى تضم خادمك يجب أن يكون لك سيرفر ديسكورد يمثله لسهولة التواصل و الإعلان https://discord.gg/jScp5Dm :يمكنك التطلع على كل مايخص الإتحاد بالديكسورد الرسمي1 point
-
Maybe this work: -- replace the conditional in line 82 for this: if #markerVault ~= 0 then for index = 1, #markerVault do destroyElement(markerVault[index]) end end1 point
-
@kieran, finally it worked, in the place of command, I made the event handler of marker, and I added the marker, and I added the team access, and it working, ty1 point
-
1 point
-
Here's an idea (someone helped me understand this as I had similar issues) try setting the players element data to the vehicle, then when they die, get the data, here's untested code, if it doesn't work do a debugscript 3 and tell me the errors. function spawnVeh (thePlayer) --This function adds a command that spawns a car and sets players data, we will remove the car later local x, y, z = getElementPosition (thePlayer) --Get players position local rotX, rotY, rotZ = getElementRotation (thePlayer) --Get there rotation veh = createVehicle (468, x, y, z+5, rotX, rotY, rotZ) --Create the vehicle at the players position +5 height warpPedIntoVehicle (thePlayer, veh) --Warp the player into the vehicle setElementData(thePlayer, "freecar", veh) --Set the players data to the car end addCommandHandler("sanchez", spawnVeh) --When command is passed we create a sanchez above and set players data function removeVehicle () local theVeh = getElementData( source, "freecar" ) --First we get the players element data if ( theVeh ~= false ) then --If the data exists, it means the vehicle exists (unless you have done above command and the car gets destroyed) destroyElement(theVeh) --Since we got the element with getElementData above we can now destroy it setElementData(source, "freecar", false) --We now set the players data to false. end end addEventHandler("onPedWasted", getRootElement(), removeVehicle) --When player dies we trigger our function to check there data Hopefully this works!1 point
-
1 point
-
Your way, but you need to use client side, or maybe an assoc server table with the car elements ( where the table keys can be the player name) , but I don't really suggest that... Just a little communication between the client and server...1 point
-
Bom. A página ficou assim: isVehicleReturning Se tiver algo faltando, erro de inglês, etc, me avise.1 point
-
1 point
-
if killer then killText = getPlayerName(killer) .. " killed you" else killText = killText .. " commit suicide " end Here, you're trying to get the player name of the killer, you can't get the player name of a ped, obviously. Try using this: if killer and isElement (killer) then if getElementType(killer)=="player" then killText = getPlayerName(killer) .. " killed you" elseif getElementType (killer)=="ped" and getElementData (killer,"zombie") then killText = "A zombie killed you" elseif killer == localPlayer then killText = "You've committed suicide." else killText = "You've died." end else killText = "You've died." end And by the way, that sure had given you a debugscript error, next time, try to analyze those errors and post something related to it so people shouldn't have to read your entire script just to get into context.1 point
-
Like this: Client function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end -- If the serverside event handler is not in the same resource, replace 'resourceRoot' with the appropriate element triggerServerEvent("onClientCallsServerFunction", resourceRoot , funcname, unpack(arg)) end if player == localPlayer then setTimer( function() callServerFunction( 'createDropPicukup', wepons_models[ weapon ], x1, y1, z1, p_rot, slot, ammo, ammoc ) end, _dropSystem[ pickup ].time +50, 1 ) end Server allowedFunctions = { ["createDropPicukup"]=true} function callServerFunction(funcname, ...) if not allowedFunctions[funcname] then -- Protect server from abuse outputServerLog( "SECURITY: " .. tostring(getPlayerName(client)) .. " tried to use function " .. tostring(funcname) ) return end local arg = { ... } if (arg[1]) then for key, value in next, arg do arg[key] = tonumber(value) or value end end loadstring("return "..funcname)()(unpack(arg)) end addEvent("onClientCallsServerFunction", true) addEventHandler("onClientCallsServerFunction", resourceRoot , callServerFunction) function createDropPicukup ( id, x, y, z, rot, slot, ammo, ammoc ) outputChatBox ( "Red #FFFFFFWhite", getRootElement(), 255, 0, 0, true ) local object = createObject ( id, x, y, z, 87, 0, rot ) setElementCollisionsEnabled ( object, false ) local marker = createMarker ( x, y, z+0.25 + math.random( 0.0500, 0.1005 ) , "corona", 1.3, color_fromSlot[ slot ].r or 255, color_fromSlot[ slot ].g or 255, color_fromSlot[ slot ].b or 255, 12.5, getRootElement() ) setElementData( marker, 'pWeapon', { getIDFromModel( id ), ammo , ammoc } ) attachElements ( marker, object ) setElementParent( object, marker ) end Look that wiki source shows both source that should've been inserted into client and server side1 point
-
Try this. Not tested though. Server-side: function changePlayerNick(player, command, target, newNick) local account = getPlayerAccount(player) local accName = getAccountName(account) if account and isGuestAccount(account) then return end if isObjectInACLGroup("user." ..accName, aclGetGroup("Admin")) then if not target or not newNick then outputChatBox("Correct command is /changenick player nick.", player, 255, 0, 0, true) return end local targetPlayer = getPlayerFromPartialName(target) if not targetPlayer then outputChatBox("No such player found.", player, 255, 0, 0, true) return end outputChatBox("You changed #FFFFFF"..getPlayerName(targetPlayer).."#00FF00's nickname to #FFFFFF"..newNick.."#00FF00.", player, 0, 255, 0, true) outputChatBox("Your nickname was changed from #FFFFFF"..getPlayerName(targetPlayer).."#00FF00 to #FFFFFF"..newNick.."#00FF00.", player, 0, 255, 0, true) setPlayerName(targetPlayer, newNick) else outputChatBox("You're not an Admin!", player, 255, 0, 0, true) return end end addCommandHandler("changenick", changePlayerNick) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end1 point
-
1 point
-
1 point
-
يعني روح نام rockabye=تهويدة قبل النوم مالها مصطلح عربي لكن يقولونها قبل النوم1 point
-
"Why reinvent the bicycle", if the basic elements are already there? Personally, I do not like working with the GUI and it's much easier for me to use the finished dxlib.1 point
-
function detect() local theVehicle = getPedOccupiedVehicle(localPlayer) if theVehicle then local getMatrix = getElementMatrix(theVehicle) local getVelocity = Vector3(getElementVelocity(theVehicle)) local getVectorDirection = (getVelocity.x * getMatrix[2][1]) + (getVelocity.y * getMatrix[2][2]) + (getVelocity.z * getMatrix[2][3]) if (getVectorDirection == 0 or getVectorDirection > 0) then return end if (getVectorDirection < 0) then print(getVectorDirection) outputChatBox("Ré") end end end setTimer(detect, 1000, 0) Tenta isso.1 point
-
1 point
-
1 point
-
Vale, entonces necesitas: function funcion(jugador,comando,parametro1) end addCommandHandler ("modopasivo",funcion)--asigna la funcion al comando "modopasivo" Dentro de esta funcion mira si está activado y usa setElementData (jugador,"modoPasivo",true) --Define al jugador si está en modo pasivo, true si lo está, false si no. para poder identificar al jugador con el modo pasivo. Ahora, para desactivar la capacidad de disparar usa: addEventHandler ("onElementDataChange",root,function(nombre) --Ocurre cuando se le hace un setElementData a alguien local modopasivo = getElementData (source,"modoPasivo") --Mira a ver si el modoPasivo está activado if nombre == "modoPasivo" then --Si el elementData que se ha cambiado es modoPasivo... if modopasivo then -- y modopasivo está activado toggleControl (jugador,"fire",false) --desactiva la capacidad de disparar. else --si no está activado toggleControl (jugador,"fire",true) --activa la capacidad de disparar end end end) --Mirate la lista de control names en la wiki de MTA Y por último function invencibilidadPasivo (atacante) if getElementData (source,"modoPasivo") then --¿Está en modo pasivo? cancelEvent() --Sí, pues cancela el daño. end end addEventHandler ("onClientPlayerDamage",root,invencibilidadPasivo) --Asigna la funcion a solo cuando un jugador se daña --ESTA FUNCIÓN ES DE CLIENTE1 point
-
بسم الله الرحمن الرحيم اليوم اقدم لكم وظيفه مفيده شوي لاصحاب السيرفرات الرول بلاي و الحرب و اي سيرفر يستعمل انظمه فلوس الوظيفه هي : convertNumberToString Sharedfunction الحين يجي وش فايده الوظيفه ؟؟ فايده الوظيفه كالتالي انك تقدر تحول الأرقام الطويله لاختصارات مثلا مليون = 1000000 الحين مثلا تبي تحطها في جريد لست او التاب او اي شي هيك الخ ... هتاخد مكان طويل او مليار و بليون و تلريون مثلا التلريون : 1000000000000 هتاخد مكان كبير لهيك سويت الوظيفه لتسهيل الأمر عليكم الوظيفه ببساطه هتسوي الرقم من : 1000000000000 1T : الي 1M : او مليون الي طيب الحين مثلا فلوسي 1 مليون و كسور مثلا 1 مليون و 500 الف كيف هتصير؟ 1.5M هتصير هيك 1K = 1 الف الخ يعني مثلا فلوسي هيك : 1555 الف كيف هتصير ؟؟ 1.55K : هتصير هيك طبعا اظن صارت واضحه فايده الوظيفه sourceCode function convertNumberToString(num) if not num then error("ERROR : function convertNumberToString bad argument #1 expected number/string, got bool") return false end num = tostring(num) if string.len(num) >= 4 and string.len(num) < 7 then num = string.format("%.1f", tonumber(num)/1000).."K" elseif string.len(num) >= 7 and string.len(num) < 10 then num = string.format("%.1f", tonumber(num)/10000000).."M" elseif string.len(num) >= 10 and string.len(num) < 13 then num = string.format("%.1f", tonumber(num)/1000000000).."B" elseif string.len(num) >= 13 then num = string.format("%.1f", tonumber(num)/1000000000000).."T" elseif string.len(num) < 4 then num = num else num = num end return num end تقدرون تختصرو الكود اكتر من هيك بالجداول بس انا صراحه ما احب استعمل الجداول كتير Example : convertNumberToString(100) -- Result : 100 convertNumberToString(1) -- Result : 1 convertNumberToString(1000) -- Result : 1K convertNumberToString(99999) -- Result : 99.99K convertNumberToString(1000000000) -- Result : 1B1 point
-
صراحةةء ابدعت والله سكربت فخم متعوب عليه ما شاء الله اهنييكك علي هاد الابداععء واصللء يابطلل ممتاز %1001 point
-
مود ممتاز لكن الثغرات الي فيه ممكن تطفي السيرفر الي مركب فيه المود ^^1 point
-
Mod Shop (tuning shop) v1.5 Description: I think it's the most awaited script by most freeroam and some RP-like servers! As its name says it is a tuning shop resource. As you probably know, tuning shops are not synched in MTA, therefore you can't modify cars just like in Single Player (SP). Here is the "saviour" who allows you to do that. You can "pimp your ride" as if you were in SP, well almost. Currently there is only one garage in each city. Features for players: * upgrading vehicles in any mod shops in SA (3 shops currently, one in each city) * animated GUI windows * camera rotating around your car while upgrading * you can upgrade any vehicle in any shop Features for scripters: * scripters have the following abilities: - functions: o getItemPrice( modid ) - returns specific item's (upgrade id) price, false otherwise o getItemName( modid ) - returns specific item's (upgrade id) name, false otherwise o getItemIDFromName( upgradename ) - returns upgrade id of the specific upgrade item's name, false otherwise (it may be a buggy function) o getVehicleModShop( vehicle ) - returns shop's marker that vehicle is currently being modified, false otherwise o isVehicleInModShop( vehicle ) - return true if vehicle is currently being modified, false otherwise o getVehicleTuner(vehicle ) - returns player element that is currently upgrading specified vehicle, false otherwise - events: o onVehicleMod - triggered when player modifies his vehicle (might be a bit buggy) - parameters: ( upgrades, colors, paintjob, shopName ) - source: the vehicle that has been upgraded (Note: these function names may not be easy to understand because of "Item" in them) Little showoff video: A bit outdated, all known bugs were fixed. Installation: Just paste the modshop.zip into your server's resources subfolder, refresh your resources (if server is running) and start the resource or start the server (if it's not running) Download link: https://community.multitheftauto.com/index.php?p= ... ils&id=169 Changelog:1 point
-
Hello again! I'm finishing my server but I have new idea, third person camera like shooters (shoulder style like RE5) I have done it with shoulder bone, everything works ok but when I use aim and shot the crosshair doesn't appear and always shot horizontally.. Why it happens? I had the same problem with FPS camera but I assumed it and I make these cam with aim and fire toggled off... screenshot of the camera in my server1 point
-
You should use not only server side... I don't know well, what you want to make, but here is, how I understand your problem: Make a marker for all: Server side: car_marker = createMarker( 0,0,0 , "checkpoint",4,0,0,255,255) setElementData(car_marker,"type","car") You can check the hit on client side: addEventHandler ( "onClientMarkerHit", getRootElement(), function() if getElementData(source,"type") == "car" then local x,y,z = getElementPosition(getLocalPlayer()) triggerServerEvent("createVeh",root,getLocalPlayer(),x,y,z) end end) Now create veh on Server: addEvent("createVeh",true) addEventHandler("createVeh",getRootElement(),function(player,x,y,z) local veh = createVehicle ( 432,x+10,y+10,z+3) triggerClientEvent(player,"synMyVeh",player,veh) end) Receive and save the car element on client and write a death handler: addEvent("synMyVeh",true) local myCar = nil addEventHandler("synMyVeh",root,function(veh) myCar = veh end) addEventHandler("onClientPlayerWasted",root,function() triggerServerEvent("deleteMyVeh",root,myCar) end) And delete only the client car in server side(maybe you can solve this in client side, not tested) addEvent("deleteMyVeh",true) addEventHandler("deleteMyVeh",getRootElement(),function(vehicle) destroyElement(vehicle) end) All the code not tested....0 points
-
addEventHandler("onPlayerWasted", root, function() if isElement(vehicles99ui)and isPedDead(source) then destroyElement(vehicles99ui) vehicles99ui = nil end end)0 points