Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/11/21 in all areas

  1. في شي باللعبة اسمه الاكسبورت، هذا راح يخليك تتصل بين السكربتات بالبداية أصنع فنكشن في السكربت يلي راح تتصل له openSettingsWindow الفنكشن مثلاً خلينا نقول يفك اللوحة خلينا نقول اسم الفنكشن خلصت منه الآن تحتاج تضيفه في ملف الميتا عشان تقدر تستعمله في السكربتات الأخرى <export function="openSettingsWindow" type="client"/> الآن بكل بساطة تستعمل الأكسبورت من السكربت الأخر مثلاً إذا جيت تضغط زر تضيف فقط exports.resourceName:openSettingsWindow() resourceName هو اسم السكربت يلي راح تتصل فيه openSettingsWindow اسم الفنكشن في السكربت الآخر call طبعا هو ذا اسم الفنكشن الأساسي .تقدر تشوف بصفحته أمثلة وشرح أكثر، لكن له إستعمال اخر يخليك تكتب اسم السكربت أسهل لك ملاحظة: الاكسبورت يكون فقط في نفس الجانب فقط كلاينت-كلاينت / سيرفر-سيرفر triggerEvent يمديك أيضاً تستعمل الأيفنتات عبر فنكشن
    2 points
  2. Hey , when the map starts every "wheel slides" (drift) see picture. after deduction occurs to lag how i remove this smoke ? help me thank you
    1 point
  3. 1 point
  4. Creating a Roleplay/RPG server? Today I have added a utility function to the wiki, which you might want to use. https://wiki.multitheftauto.com/wiki/GetPedGender --[[ The command /gender will display the gender of your player/ped element. ]] addCommandHandler("gender", function () outputChatBox("My gender: " .. tostring(getPedGender(localPlayer))) end)
    1 point
  5. I think you are talking about plausible self protection logic in resources. I recommend you to compile the scripts which come with such protective steps. You can prevent the loading of a script under a certain condition by putting the check at the very top of the script, above everything else. For example, let's check for the existence of a file called "LICENSE". do local doesLicenseFileExist = fileExists("LICENSE"); if not (doesLicenseFileExist) then error("FATAL ERROR: LICENSE file missing!"); end -- TODO: calculate the MD5 of the LICENSE file and put it here as constant. local md5_of_license = string.toupper(""); local fh = fileOpen("LICENSE"); if not (fh) then error("FATAL ERROR: failed to open LICENSE file for checksum verification!"); end local fcontent = fileRead(fh, fileGetSize(fh)); fileClose(fh); local fcontent_md5 = md5(fcontent); if not (fcontent_md5 == md5_of_license) then error("FATAL ERROR: LICENSE file has changed! (MD5 found " .. fcontent_md5 .. ", expected " .. md5_of_license .. ")"); end end ... By using checksum verification you leave open a small window of chance that the attacker does modify your license in such a way that he created a different LICENSE file with the same hash as your original. But doing so should create a LICENSE file which does not feasibly originate from you so it is easy to argument your way out of it in a trial. The attacker could hijack the fileOpen, fileRead, fileExists, fileGetSize, fileClose and md5 functions by providing own implementations. This hijack would not be detectible and would circumvent your protection. That is why there is no perfect protection but putting these steps does present the argument that you want your code protected which is enough in a trial.
    1 point
  6. The only way right now is it to interrupt the entering task, like you do when you hold movement keys as a player during jacking. If you set the "backwards" control state after jacking starts, you can do this. The current implementation of jacking is very lacking in this aspect. If jacking is aborted for one of many reasons, the server doesn't know how far the jacker is, ie. if he physically pulled out the jacked ped yet, so it relies on the jacker to abort properly. But for peds, if the syncer changes the jacking isn't aborted properly and the jacker will be warped into the car. This is something I plan on improving, and also add a client and server event for when jacking physically starts, as it could be useful in many scripts. -- onClientPedJacked: when a ped/player has been actually jacked from a vehicle by the local player or syncing ped. -- Source: ped that got jacked -- 1st parameter: ped that jacked the other ped addEvent("onClientPedJacked", false) local ENTER_RESPONSE_TIMEOUT = 600 -- Time for server to ack our entry request and we start entering otherwise we consider it declined -- Sub tasks to indicate we are actually jacking now local PED_JACK_TASKS = { ["TASK_SIMPLE_CAR_SHUFFLE"] = true, -- Jacking through passenger seat ["TASK_SIMPLE_CAR_QUICK_DRAG_PED_OUT"] = true, ["TASK_SIMPLE_CAR_SLOW_DRAG_PED_OUT"] = true, ["TASK_SIMPLE_CAR_GET_IN"] = true, -- Jumping on a bike from the front } local timerData = {} local getPedTask = getPedTask local isElement = isElement local getVehicleController = getVehicleController local function stopEnterVehicleTimer() timerData[sourceTimer] = nil killTimer(sourceTimer) end local function onEnterVehicleFrame() if not isElement(timerData[sourceTimer].jackingPed) then return stopEnterVehicleTimer() end local pedTaskComplex, pedTaskSimple = getPedTask(timerData[sourceTimer].jackingPed, "primary", 3) if not pedTaskComplex then pedTaskComplex = "" end if pedTaskComplex:sub(1, 22) ~= "TASK_COMPLEX_ENTER_CAR" then if timerData[sourceTimer].enterTaskActive then return stopEnterVehicleTimer() else if getTickCount() - timerData[sourceTimer].enterTick > ENTER_RESPONSE_TIMEOUT then return stopEnterVehicleTimer() end end return end timerData[sourceTimer].enterTaskActive = true if PED_JACK_TASKS[pedTaskSimple] then triggerEvent("onClientPedJacked", timerData[sourceTimer].jackedPed, timerData[sourceTimer].jackingPed) return stopEnterVehicleTimer() end if not isElement(timerData[sourceTimer].veh) then return stopEnterVehicleTimer() end if not isElement(timerData[sourceTimer].jackedPed) then return stopEnterVehicleTimer() end if getVehicleController(timerData[sourceTimer].veh) ~= timerData[sourceTimer].jackedPed then return stopEnterVehicleTimer() end end local function onClientVehicleStartEnter(jackingPed, seat, door) if jackingPed ~= localPlayer and not isElementSyncer(jackingPed) then return end if seat ~= 0 then return end local jackedPed = getVehicleController(source) if not jackedPed then return end for k,v in ipairs(timerData) do if v.jackingPed == ped then return end end local timer = setTimer(onEnterVehicleFrame, 0, 0) timerData[timer] = { enterTick = getTickCount(), jackingPed = jackingPed, jackedPed = jackedPed, veh = source, enterTaskActive = false, } end addEventHandler("onClientVehicleStartEnter", root, onClientVehicleStartEnter) You can use above snippet, "onClientPedJacked" triggers when ped is physically getting jacked by local player or syncing ped. Set control state "backwards" when this event triggers, and release it again when the ped is no longer entering (see TASK_COMPLEX_ENTER_CAR in the snippet above). Let me know if you need an example for that.
    1 point
×
×
  • Create New...