Jump to content

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


Recommended Posts

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

محتاج مساعده بكود

لمنه اللاعب يضغط الزر

يوقف ذا

triggerClientEvent(source,"showToPlayer",source,getPlayerName(attaker),weapon,health,loss,bo)

في كلمة يوقف يبطل يشتغل

وشكراً

Link to comment

client

green = guiCreateLabel(184,519,609,21,"",false) 
guiSetFont(green,"default-bold-small") 
red = guiCreateLabel(184,541,609,21,"",false) 
guiSetFont(red,"default-bold-small") 
  
shot = {} 
kill = {} 
  
  
  
addEventHandler("onClientPedDamage",root, 
    function (attaker,weapon,bo,loss) 
        if ( attaker and attaker == localPlayer ) then 
            if ( kill[localPlayer] ) then 
                killTimer(kill[localPlayer]) 
            end 
            guiSetText(green,"+" .. math.ceil(loss) .. "% / Zombie / " .. bo .. " / " .. getWeaponNameFromID(weapon) .. " / +" .. math.ceil(getElementHealth(source)) .. "%") 
            guiLabelSetColor(green,0,255,0) 
            kill[localPlayer] = setTimer(guiSetText,5000,1,green,"") 
        end 
    end 
) 
  
addEvent("showToPlayer",true) 
addEventHandler("showToPlayer",root, 
    function (name,weapon,health,loss,bo) 
        if ( shot[localPlayer] ) then 
            killTimer(shot[localPlayer]) 
        end 
        guiSetText(red,"-" .. loss .. "% / Zombie / " .. bo .. " / " .. getWeaponNameFromID(weapon) .. " / -" .. health .. "%") 
        guiLabelSetColor(red,255,0,0) 
        shot[localPlayer] = setTimer(guiSetText,5000,1,red,"") 
    end 
) 
  

server

addEventHandler("onPlayerDamage",root, 
    function (attaker,weapon,bo,loss) 
        local health = math.ceil(getElementHealth(source)) 
        local loss = math.ceil(loss) 
        if ( attaker and getElementType(attaker) == "ped" ) then 
            triggerClientEvent(source,"showToPlayer",source,getPlayerName(attaker),weapon,health,loss,bo) 
        end 
    end 
) 
  
  
addEventHandler("onPedWasted",root, 
    function (_,killer) 
        local money = math.random(200,1000) -- You Can Change This 
        if ( killer and killer ~= source ) then 
            givePlayerMoney(killer,money) 
            outputChatBox( 
  
"* You won #00ff00" .. money .. "$ #ff00fffor killing a zombie."  
  
,killer,0,255,255,true) -- You Can Change This 
        end 
    end 
) 

Edited by Guest
Link to comment
عشان نقدر نشوف الكود lua ما فهمت وبعدين رجاء استخدم

؟ showToPlayer الان انت قصدك تبي توقف ارسال التريقر اللي اسمه

ومتى تبي توقفه ؟ ولا تبي تشيله نهائيا يعني ! ؟

انا قصدي يوقف للاعب المحدد الي يضغط الزر باللوحه

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...