Jump to content

billal

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by billal

  1. ستواجهك مشكلة لان المود لا يشتغل لما تحول كتابة بالعربي لذلك اقترح تستخدم الارقام بدل الحروف مثلا غير ملف الكلينت كالتالي addEventHandler( "onClientKey", getRootElement(), function (button , prees) if prees then if button == "num_0" then ------------------------------------ هنا تختار الرقم اللي يمسح الشات triggerServerEvent("onClearChat", localPlayer) end end end )
  2. Client Side: -------------------------------------------------------------------------------------- addEventHandler( "onClientKey", getRootElement(), function (button , prees) if prees then if button == "m" then ---------------------------------------------- من هون تختار الحرف اللي يمسحلك الشات triggerServerEvent("onClearChat", localPlayer) cancelEvent() end end end) ----------------------------------------------------- Server Side: ? ranks = {"Console","Admin"} -- الرتب الي يمديها تمسح الشات --------------------------------------- addEvent("onClearChat",true) addEventHandler("onClearChat",root, function() local accountName = getAccountName ( getPlayerAccount ( source ) ) for k,v in ipairs ( ranks ) do if isObjectInACLGroup ("user."..accountName, aclGetGroup ( v ) ) then for i = 0, 40 do outputChatBox(" ",root,255,255,255) end outputChatBox("* Cleared The Chat By [#c10000"..getPlayerName(source).."#ffffff].",root,255,255,255,true) end end end )
  3. مشكلة بالمود لما تدخل المنطقة صحيح الصورة تجي فوق الابجكت لكن لو كان نفس الابجكت بمكان اخر على الماب تنحط الصورة فوقه كمان لكن انا ابي الصورة تجي فوق الابجكت في المكان المحدد بس يعني لما نفس الابجكت2993يكون بمكان اخر لا تجي الصورة فوقه
  4. ايه اشوا , كله ولا زعلك يسلمو شباب شكرا لكم
  5. ممكن الكود جاهز
  6. يا اوسكار ابي احط صورة فوق ابجكت لكن في منطقة محددة بس
  7. السلام عليكم ابي فنكش عشان الابجكت المعدل عليه يكون بمنطقة محددة فقط --- حدا يصحح الكود ss = createRadarArea(2400, -1700,200,200,0,250,0,200) A = createObject(2914,2476.2,-1665.3,12.6,0,0,0) addEventHandler("onClientResourceStart", ss, function ( ) txd = engineLoadTXD("2914.txd") engineImportTXD(txd, 2914) end)
  8. شكرا + ابي كمان فنكش عشان احط الصورة على الابجكت في مكان محدد بس على الماب ومش على كل اللعبة
  9. shaders تقصد fx. لكن كيف اعمل الملفات بصيغة شو البرنامج اللي يفتحها
  10. السلام عليكم ابي فنكش احط صورة على ملف TXD دون الحاجة لبرنامج txd workshop بعبارة اخرى ابي احط صورة photo.png داخل المود وش الفنكش عشان الصورة تضهر فوق الملف TXD باللعبة
  11. billal

    فكشن

    ddEventHandler('onMarkerHit',marker,function(entered) if getElementType(entered) == 'player' and not isPedInVehicle(entered) then setElementPosition( entered,x,y,z) setElementInterior ( entered, 0 ) setElementDimension ( entered, 0 ) end end
  12. createColCuboid guiSetVisible guiSetEnabled
  13. billal

    ...

    كفؤ جداااا اوسكار+اسف اني تعبتك كتير معايا
  14. billal

    ...

    الحين فهمتك يا اوسكار يعني كل مرة تختار رسباون انا كنت ابي تختار مرة واحدة يبقى يشتغل تلقائي كل ماتموت ياخذك لمشفى المدينة اللي انت فيها
  15. function narotu() txd = engineLoadTXD ( "9.txd" ) engineImportTXD ( txd, 7910 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), narotu) meta "9.txd" /> "11.txd" /> TXDرابط ملف http://arabsh.com/files/0b34404e67f2/9-txd.html
  16. مقاس الصورة لازم يكون 512×128
  17. billal

    ...

    شكرا يا اوسكار لكن في مشكلة يرسن بالمشفى فقط
  18. setElementPosition ------- مكان ذهاب اللاعبx,y,z setElementInterior-------ذي خليها0 setElementDimension-----العالم هاذا اللي لازم تغير عليه
  19. billal

    ...

    -- C is_spawn_protected = nil --[[ Get spawn protection ]]-- function set_spawn_protection(time_s) is_spawn_protected = setTimer(function() end, time_s*1000, 1) end addEvent("GTWhospital.setSpawnProtection", true) addEventHandler("GTWhospital.setSpawnProtection", localPlayer, set_spawn_protection) --[[ Protect players from taking damage on spawn]]-- function protect_spawn(attacker, weapon, bodypart) if not isTimer(is_spawn_protected) then return end cancelEvent() end addEventHandler("onClientPlayerDamage", localPlayer, protect_spawn) --[[ Protect players from being choked upon spawn ]]-- function protect_spawn_choke(weaponID, responsiblePed) if not isTimer(is_spawn_protected) then return end cancelEvent() end addEventHandler("onClientPlayerChoke", localPlayer, protect_spawn_choke) --[[ Global spawn sound handler ]]-- function onSoundEvent(cmd, sound) playSoundFrontEnd(tonumber(sound)) end addCommandHandler("sound", onSoundEvent) -- S timers = { } awaiting_spawn = { } weapon_list = {{ }} ammo_list = {{ }} -- List of available hospitals hs_table = { -- x y z rot view x view y view z [1]={ 1177, -1320, 14.137756347656, 270, 1200.6923828125, -1324.9873046875, 20.398437 }, [2]={ -2666, 630, 13.567041397095, 180, -2664.4501953125, 611.0771484375, 20.454549789429 }, [3]={ 1607, 1818, 10.8203125, 0, 1607.3310546875, 1839.7470703125, 16.8203125 }, [4]={ 2040, -1420, 16.9921875, 90, 2031.8486328125, -1419.5927734375, 22.9921875 }, [5]={ -2200, -2308, 30.625, -45, -2193.5888671875, -2301.6630859375, 36.625 }, [6]={ 208, -65.3, 1.4357746839523, 180, 208.310546875, -75.525390625, 7.4357746839523 }, [7]={ 1245.8, 336.9, 19.40625, -20, 1250.3759765625, 346.681640625, 25.40625 }, [8]={ -317.4, 1056.4, 19.59375, 0, -316.8125, 1066.306640625, 25.59375 }, [9]={ -1514.8, 2527.9, 55.6875, 1.790, -1514.283203125, 2536.412109375, 61.6875 }, } -- Cost of the healthcare hs_charge = 500 hs_respawn_time = 10 -- Check GTWjail respawn times if you decide to change this value! hs_spawn_protection_time = 20 --[[ Load all the hospitals from the table ]]-- function load_hospitals() for i=1, #hs_table do createBlip(hs_table[i][1], hs_table[i][2], hs_table[i][3], 22, 1, 0, 0, 0, 255, 2, 180) local h_marker = createMarker(hs_table[i][1], hs_table[i][2], hs_table[i][3]-1, "cylinder", 2, 0, 200, 0, 30) addEventHandler("onMarkerHit", h_marker, hs_start_heal) addEventHandler("onMarkerLeave", h_marker, hs_stop_heal) end end addEventHandler("onResourceStart", resourceRoot, load_hospitals) --[[ Return the nearest hospital depending on a players location ]]-- function get_nearest_hospital(plr) if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end local n_loc,min = nil,9999 for k,v in ipairs(hs_table) do -- Get the distance for each point local px,py,pz=getElementPosition(plr) local dist = getDistanceBetweenPoints2D(px,py,v[1],v[2]) -- Update coordinates if distance is smaller if dist < min then n_loc = v min = dist end -- 2015-03-01 Dead in interior? respawn at LS hospital if getElementInterior(plr) > 0 then break end end -- Check if jailed or not and return either hospital or jail local isJailed = exports.GTWjail:isJailed(thePlayer) if not isJailed then return n_loc[1]+math.random(-1,1),n_loc[2]+math.random(-1,1),n_loc[3],n_loc[4],n_loc[5],n_loc[6],n_loc[7] else return -2965+math.random(-5,5),2305+math.random(-5,5),9,270 end end --[[ Toggle controls for a player ]]-- function toggle_controls(plr, n_state) if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end toggleControl(plr, "jump", n_state) toggleControl(plr, "sprint", n_state) toggleControl(plr, "crouch", n_state) toggleControl(plr, "fire", n_state) toggleControl(plr, "aim_weapon", n_state) toggleControl(plr, "enter_exit", n_state) toggleControl(plr, "enter_passenger", n_state) toggleControl(plr, "forwards", n_state) toggleControl(plr, "walk", n_state) toggleControl(plr, "backwards", n_state) toggleControl(plr, "left", n_state) toggleControl(plr, "right", n_state) toggleControl(plr, "vehicle_fire", n_state) end --[[ Respawn after death "onPlayerSpawn" ]]-- function player_Spawn(x,y,z, r, team_name, skin_id, int,dim) -- Check if a player is picked up by an ambulance if not awaiting_spawn[source] then return end -- Restore weapons if weapon_list[source] and ammo_list[source] then for k,wep in ipairs(weapon_list[source]) do if weapon_list[source][k] and ammo_list[source][k] then -- Return ammo to the player giveWeapon(source, weapon_list[source][k], ammo_list[source][k], false) -- Clean up used space weapon_list[source][k] = nil ammo_list[source][k] = nil end end end -- Check if jailed local isJailed = exports.GTWjail:isJailed(source) if isJailed then return end -- Set camera view target local x,y,z, r, vx,vy,vz = get_nearest_hospital(source) setCameraMatrix(source, vx,vy,vz, x,y,z, 0,75) -- Fade in the camera and set it's target fadeCamera(source, true, 6,255,255,255) -- Make sure the player is not frozen setElementFrozen(source, false) toggle_controls(source, false) setTimer(finish_spawn, 8000, 1, source) -- Set health to 30 setElementHealth(source, 30) -- Reset ambulance data awaiting_spawn[source] = nil -- Infom the player about his respawn exports.GTWtopbar:dm("Hospital: You have been healed at "..getZoneName(x,y,z)..", for a cost of $"..hs_charge, source, 255, 100, 0) end addEventHandler("onPlayerSpawn", root, player_Spawn) --[[ Helper function for spawn triggers and style ]]-- function finish_spawn(plr) if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end setCameraTarget(plr, plr) -- Enable controls toggle_controls(plr, true) -- Play a spawn sound playSoundFrontEnd(plr, 11) -- Enable spawn protection triggerClientEvent(plr, "GTWhospital.setSpawnProtection", plr, hs_spawn_protection_time) end --[[ On player wasted, fade out and send to hospital ]]-- function on_death(ammo, attacker, weapon, bodypart) -- Save all weapons currently hold by a player weapon_list[source] = { 0,0,0,0,0,0,0,0,0,0,0,0 } ammo_list[source] = { 0,0,0,0,0,0,0,0,0,0,0,0 } -- Check all weapon slots and save their ammo for k,v in ipairs(weapon_list[source]) do weapon_list[source][k] = getPedWeapon(source, k) setPedWeaponSlot(source, k) ammo_list[source][k] = getPedTotalAmmo(source, k) end -- Check if jailed or not local isJailed = exports.GTWjail:isJailed(source) if isJailed then return end -- Make sure warp to hospital is possible if getPedOccupiedVehicle(source) then removePedFromVehicle(source) end -- Take some of the money takePlayerMoney(source, hs_charge) fadeCamera(source, false, 8, 0, 0, 0) -- Respawn player after "hs_respawn_time" seconds setTimer(plr_respawn, hs_respawn_time*1000, 1, source) -- Add to respawn awaiting_spawn[source] = true -- Notify player about his death exports.GTWtopbar:dm("Hospital: You are dead! an ambulance will pick you up soon", source, 255, 100, 0) end addEventHandler("onPlayerWasted", root, on_death) --[[ Helper function to spawn player ]]-- function plr_respawn(plr) if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end local x,y,z, r, vx,vy,vz = get_nearest_hospital(plr) spawnPlayer(plr, x,y,z+1, r, getElementModel(plr), 0,0, getPlayerTeam(plr)) end --[[ Dump weapons into users database on quit ]]-- function dump_weapons() -- Get player account local acc = getPlayerAccount(source) -- Reset ambulance data awaiting_spawn[source] = nil -- Check if there is any weapons in memory if not weapon_list[source] then return end -- Save the weapons and ammo stored in memory for k,w in ipairs(weapon_list[source]) do if weapon_list[source][k] and ammo_list[source][k] then setAccountData(acc, "acorp.weapon."..tostring(k), weapon_list[source][k]) setAccountData(acc, "acorp.ammo."..tostring(k), ammo_list[source][k]) end end end addEventHandler("onPlayerQuit", root, dump_weapons) --[[ Heal player once in a health marker ]]-- function hospital_heal(plr) if not plr or not isElement(plr) or getElementType(plr) ~= "player" then return end local health = getElementHealth(plr) local charge = math.floor(hs_charge/10) if health < 90 and getPlayerMoney(plr) >= charge then setElementHealth(plr, health+10) takePlayerMoney(plr, charge) elseif getPlayerMoney(plr) >= charge then setElementHealth(plr, 100) takePlayerMoney(plr, charge) exports.GTWtopbar:dm("Hospital: Go away, you're fine!", plr, 255, 100, 0) if isTimer(timers[plr]) then killTimer(timers[plr]) end elseif getPlayerMoney(plr) < charge then exports.GTWtopbar:dm("Hospital: You can't afford the healthcare!", plr, 255, 0, 0) end end addCommandHandler("gtwinfo", function(plr, cmd) outputChatBox("[GTW-RPG] "..getResourceName( getThisResource())..", by: "..getResourceInfo( getThisResource(), "author")..", v-"..getResourceInfo( getThisResource(), "version")..", is represented", plr) end) --[[ Start an healing timer, increasing the health of a player ]]-- function hs_start_heal(hitElement, matchingDimension) if isTimer(timers[hitElement]) then killTimer(timers[hitElement]) end if getElementHealth(hitElement) < 90 then exports.GTWtopbar:dm("Stay in the marker to get healed!", hitElement, 255, 100, 0) timers[hitElement] = setTimer(hospital_heal, 1400, 0, hitElement) end end --[[ Stop and kill the heal timers ]]-- function hs_stop_heal(plr, matchingDimension) if isTimer(timers[plr]) then killTimer(timers[plr]) end end
×
×
  • Create New...