abos3od02 Posted January 3, 2014 Share Posted January 3, 2014 السسلآإم عليكم ي ششبآإب صآر لي كم يؤم آدور على كؤد آظههآإر عدد القتل والموت بـ التاب .. وماحصصلته .. يعني الي عنده الكؤد لايبخل علينا <3 Link to comment
al-Kobra Posted January 3, 2014 Share Posted January 3, 2014 (edited) https://community.multitheftauto.com/in ... ls&id=3472 https://community.multitheftauto.com/in ... ls&id=4832 Edited January 3, 2014 by Guest Link to comment
#DRAGON!FIRE Posted January 3, 2014 Share Posted January 3, 2014 السسلآإم عليكمي ششبآإب صآر لي كم يؤم آدور على كؤد آظههآإر عدد القتل والموت بـ التاب .. وماحصصلته .. يعني الي عنده الكؤد لايبخل علينا <3 تفضل : https://community.multitheftauto.com/in ... ls&id=3472 Link to comment
abos3od02 Posted January 3, 2014 Author Share Posted January 3, 2014 يععطيكم آلعإآفيهه Link to comment
#DRAGON!FIRE Posted January 3, 2014 Share Posted January 3, 2014 يععطيكم آلعإآفيهه الله يعافيكـ , .. Link to comment
abos3od02 Posted January 3, 2014 Author Share Posted January 3, 2014 امممممممممم بس المود الي اعطيتوني اياه يحسب عدد القتل الكلي يعني الي قتلته من قبل والي قتلته الحين لا ابي الي اول مايدخل السيرفر يبدأ يحسب .. واذا طلع يروح Link to comment
#DRAGON!FIRE Posted January 3, 2014 Share Posted January 3, 2014 امممممممممم بس المود الي اعطيتوني اياهيحسب عدد القتل الكلي يعني الي قتلته من قبل والي قتلته الحين لا ابي الي اول مايدخل السيرفر يبدأ يحسب .. واذا طلع يروح بالعكس كذا احسن لك ججرب . Server Side ! addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"totalkillsdeaths.Kills",tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) or 0 ) +1 ) setElementData( killer, "T/K", tonumber( getAccountData( account,"totalkillsdeaths.Kills" ) ) ) setElementData( killer, "K/D/R", tonumber(getElementData( killer, "T/K" )/getElementData( source, "T/D") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"totalkillsdeaths.Deaths",tonumber( getAccountData(accountSource,"totalkillsdeaths.Deaths") or 0 ) +1 ) setElementData( source, "T/D", tonumber( getAccountData( accountSource,"totalkillsdeaths.Deaths" ) ) ) setElementData( source, "K/D/R", getElementData( killer, "T/K" )/getElementData( source, "T/D") ) end end ) addEventHandler( "onPlayerQuit",root, function( ) local account = getPlayerAccount ( source ) if not getAccountData( account,"totalkillsdeaths.Kills" ) and not getAccountData( account,"totalkillsdeaths.Deaths" ) then return end setAccountData( account,"totalkillsdeaths.Kills",0 ) setAccountData( account,"totalkillsdeaths.Deaths",0 ) end setElementData( source,"T/D",0 ) setElementData( source,"T/K",0 ) setElementData( source, "K/D/R", 0 ) end ) addEventHandler( "onResourceStart",resourceRoot, function( ) outputDebugString( "add Total Kills to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "T/K",root,2, 0.032 ) ) ) outputDebugString( "add K/D R to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "K/D/R",root,4, 0.047 ) ) ) outputDebugString( "add Total Deaths to scoreboard Return: "..tostring( call( getResourceFromName("Scoreboard"), "addScoreboardColumn", "T/D",root,3, 0.032 ) ) ) end ) Link to comment
al-Kobra Posted January 4, 2014 Share Posted January 4, 2014 local root = getRootElement() local scoresRoot = getResourceRootElement(getThisResource()) local scoreColumns = {"kills", "deaths"} local isColumnActive = {} local KDR_DECIMAL_PLACES = 2 local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end local function setScoreData (element, column, data) if isColumnActive[column] then setElementData(element, column, data) end end local function resetScores (element) setScoreData(element, "kills", 0) setScoreData(element, "deaths", 0) end function updateActiveColumns () for i, column in ipairs(scoreColumns) do if get(column) then isColumnActive[column] = true exports.scoreboard:addScoreboardColumn(column) elseif isColumnActive[column] then isColumnActive[column] = false exports.scoreboard:removeScoreboardColumn(column) end end end addEventHandler("onResourceStart", scoresRoot, function () updateActiveColumns() for i, player in ipairs(getElementsByType("player")) do resetScores(player) end end ) addEventHandler("onResourceStop", scoresRoot, function () for i, column in ipairs(scoreColumns) do if isColumnActive[column] then exports.scoreboard:removeScoreboardColumn(column) end end end ) addEventHandler("onPlayerJoin", root, function () resetScores(source) end ) addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon) if killer then if killer ~= source then setScoreData(killer, "kills", getElementData(killer, "kills") + 1) setScoreData(source, "deaths", getElementData(source, "deaths") + 1) end else setScoreData(source, "deaths", getElementData(source, "deaths") + 1) end ) جرب هذا + في مود في مودات السيرفر اسمه score 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