Jump to content

مساعده اخواني


Recommended Posts

بسم الله الرحمن الرحيم السلام عليكم ورحمة الله وبركاته

في البدايه الكود

function onWasted ( killer ) 
    if ( killer ) and ( killer ~= source ) and ( killer == getLocalPlayer() ) then 
        if ( isTimer ( timer ) ) then 
            killTimer ( timer ) 
        end 
h = guiCreateLabel(350, 210, 701, 60, "Wasted", false) 
guiSetVisible(h, false) 
guiSetVisible(h, true) 
setTimer (guiSetVisible, 1000, 1, h, false ) 
local sound = playSound("a.mp3") 
setSoundVolume(sound, 0.7) 
    end 
end 
addEventHandler ( "onClientPlayerWasted", getRootElement(), onWasted ) 

الكود صحيح لاكن ابغى كل مايقتل واحد تجيه رساله مختلفه ماتجي نفس الرساله

مثلا لو قتل الأول تجيه

وصوت مخصص لها

h = guiCreateLabel(350, 210, 701, 60, "Wasted", false) 

واذا قتل الثاني

وصوت مخصص لها

hh = guiCreateLabel(350, 210, 701, 60, "good", false) 

ومشكورين مقدما

Link to comment

مشكور حبيبي وماقصرت لاكن قولي وش الخطأ في هاذا طيب

function onWasted ( killer ) 
    if ( killer ) and ( killer ~= source ) and ( killer == getLocalPlayer() ) then 
        if ( isTimer ( timer ) ) then 
            killTimer ( timer ) 
local x, y, z = getElementPosition(source) 
local pick = createPickup ( x, y, z, 3, 1550, 30000, 5000 )   
marker = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 0, 0) 
setElementInterior( pick, 3, x, y, z ) 
    if marker then 
        destroyElement(pick) 
        destroyElement(marker )         
triggerServerEvent("giveMoney", localPlayer) 
    end 
end 
        end 
    end 
end 
addEventHandler("onClientMarkerHit", marker, onWasted) 
addEventHandler ( "onClientPlayerWasted", getRootElement(), onWasted ) 
  

المقصود من هذاا االكود لما يموت شخص يجي مكانه ماركر + الأوبجكت

pick

ومشكور

Link to comment
كودك غير مفهوم

قول انت وش تبي وانا اسويه

لما يموت شخص تطلع له شنطه فلوس ولما ياخذها الشخص تنحذف وتجيه فلوس فهمت لما يموت الشخص يجي محل مامات شنطه فلوس وياريت كان واضح

Link to comment

يالغالي مايحتاج لذا كلنت وترايقر

على طول سويه سيرفر سايد

هذا الكود

server.lua

  
function wasted( ammo,killer ) 
    if killer and killer ~= source then 
local x, y, z = getElementPosition(source) 
local pick = createObject ( 1550, x, y, z )  
local marker = createMarker ( x, y, z, "cylinder", 1.5, 0, 0, 0, 0) 
    addEventHandler ( "onMarkerHit", marker, 
    function ( hitElement ) 
    if (hitElement and getElementType(hitElement) == "player") then  
    local money = math.random(100,150) ---هنا الفلوس اللي يربحها من 100 الى 150 
    local Name = getPlayerName(hitElement)   
        destroyElement ( pick )  
        destroyElement ( marker )        
        givePlayerMoney ( hitElement, money ) 
        outputChatBox("#FFFF1A[#FFFFFF "..Name.." #FFFF1A] Has Won "..money.."$" ,root, 255, 255,0,true ) -- هذا بالشات يطلع له اول مايأخـذ الفلوس 
    end 
end)                 
    end 
end 
addEventHandler( "onPlayerWasted",root,wasted ) 
  

Link to comment

معليش شباب آسف تعبتكم لاكن باقي طلب واحد

اصوات الأسلحه ابغاه يشتغل بزر ويطفي بزر

تفضلو

local function playGunfireSound(weaponID) 
    local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition(source) 
    local px, py, pz = getElementPosition ( source ) 
  
       if weaponID == 22 then --colt45 
            local sound = playSound3D("sounds/weap/Colt45.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 23 then 
            local sound = playSound3D("sounds/weap/Silenced.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 24 then--deagle 
            local sound = playSound3D("sounds/weap/Deagle.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 25 then--shotgun 
            local sound = playSound3D("sounds/weap/Shotgun.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 26 then--sawn-off 
            local sound = playSound3D("sounds/weap/Sawed-Off.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 27 then--combat shotgun 
            local sound = playSound3D("sounds/weap/Combat Shotgun.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 28 then--uzi 
            local sound = playSound3D("sounds/weap/UZI.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 32 then--tec-9 
            local sound = playSound3D("sounds/weap/tec9.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 29 then--mp5 
            local sound = playSound3D("sounds/weap/MP5.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 30 then--ak47 
            local sound = playSound3D("sounds/weap/AK-47.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 31 then--m4 
         sounnd = playSound3D("sounds/weap/M4.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 33 then--rifle 
            local sound = playSound3D("sounds/weap/Rifle.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    elseif weaponID == 34 then--sniper 
            local sound = playSound3D("sounds/weap/Sniper.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
    end 
end 
addEventHandler("onClientPlayerWeaponFire", root, playGunfireSound) 

وماقصرتو

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...