darbka2002 Posted April 27, 2016 Share Posted April 27, 2016 شباب ممكن مساعدة فى مود dmarea المود يظهر عدد الناس الذى قتلهم الاول فى dmarea و يظهر عدد القتلة الذى انت قتلتهم المشكلة انه ما يظهر امس topkiller client v = {aPosX = 1287, aPosY = 2066, aSizeX = 186, aSizeY = 180, spawn = {1383, 2187, 11, 180}} dmarea = createColRectangle(v["aPosX"], v["aPosY"], v["aSizeX"], v["aSizeY"]) function projectileCreation(creator) if (creator) and isElementWithinColShape ( creator, dmarea ) then setElementPosition(source, 9000, 9000, 0) end end addEventHandler("onClientProjectileCreation", root, projectileCreation) server v = {aPosX = 1287, aPosY = 2066, aSizeX = 186, aSizeY = 180, spawn = {1383, 2187, 11, 180}} topkiller = { acc = "MrFares", kills = 1 } spawns = { {1383, 2187, 11, 180}, {1361, 2173, 19, 188}, {1316, 2167, 16, 89}, {1342, 2123, 15, 359}, {1318, 2090, 15, 59}, {1428, 2151, 29, 87}, } dmarea = createColRectangle(v["aPosX"], v["aPosY"], v["aSizeX"], v["aSizeY"]) killers = {} addEventHandler( "onPlayerWasted", getRootElement( ), function( ammo, attacker, weapon, bodypart ) if isElementWithinColShape ( source, dmarea ) then if killers[getAccountName(getPlayerAccount(attacker))] then kills = tonumber(killers[getAccountName(getPlayerAccount(attacker))]) + 1 else kills = 1 end killers[getAccountName(getPlayerAccount(attacker))] = kills local mkils = kills exports.CILhelp:modTextBar(attacker, "dmarea", "My Kills: ("..mkils..")", 150, 0, 150, 255) if tonumber(kills) >= tonumber(topkiller["kills"]) then topkiller["acc"] = getAccountName(getPlayerAccount(attacker)) topkiller["kills"] = kills for ind,plr in ipairs(getElementsWithinColShape(dmarea)) do local aname = tostring(exports.CILgang:getAccountLastNick(topkiller["acc"])) or topkiller["acc"] exports.CILhelp:modTextBar(plr, "dmareaa", "Top Killer:"..aname.." ("..topkiller["kills"]..")", 150, 0, 150, 255) end end setAccountData(getPlayerAccount(source),"dmarea",true) end end ) addEventHandler("onPlayerSpawn", root, function() if getAccountData(getPlayerAccount(source),"dmarea") then local nad1 = math.random(3,15) v = spawns[math.random(#spawns)] y = v[2]+nad1 setElementPosition(source, v[1], y, v[3]) setPedRotation(source, v[4]) setTimer(function(source) setCameraTarget(source) end, 50, 1, source) setAccountData(getPlayerAccount(source),"dmarea",false) end end) function hill_Enter ( plr, matchingDimension ) if getElementType ( plr ) == "player" then --if the element that entered was player local aname = tostring(exports.CILgang:getAccountLastNick(topkiller["acc"])) or topkiller["acc"] exports.CILhelp:modTextBar(plr, "dmareaa", "Top Killer:"..aname.." ("..topkiller["kills"]..")", 150, 0, 150, 255) local mkils = tonumber(killers[getAccountName(getPlayerAccount(plr))]) or 0 exports.CILhelp:modTextBar(plr, "dmarea", "My Kills: ("..mkils..")", 150, 0, 150, 255) end end addEventHandler ( "onColShapeHit", dmarea, hill_Enter ) -- add hill_Enter as a handler for when a player leaves the hill area function hill_Exit ( plr, matchingDimension ) if getElementType ( plr ) == "player" then --if the element that left was player exports.CILhelp:modTextBar(plr, "dmareaa", "", 150, 0, 150, 255) exports.CILhelp:modTextBar(plr, "dmarea", "", 150, 0, 150, 255) end end addEventHandler ( "onColShapeLeave", dmarea, hill_Exit ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now