A7M8D Posted July 22, 2017 Share Posted July 22, 2017 @iMr.WiFi..! اها هههه بحسبك بتقول عليا لان الكود اصلا 4 سطور كله وانا تعبان جدا مكنتش مركز Link to comment
MA[S]RIY Posted July 22, 2017 Author Share Posted July 22, 2017 24 minutes ago, iMr.WiFi..! said: --[[ الكود الاول ]] -- حط الكود ذا في مود الديربي عند لما اللاعب يفوز local winner = source; -- بدلها باللاعب الي فاز if not isGuestAccount ( getPlayerAccount ( winner ) ) then setAccountData ( getPlayerAccount ( winner ), "DerbyPoint", ( getAccountData ( getPlayerAccount ( winner ) ) or 0 ) + 1 ) end --[[الكود الثاني]] -- حطه في مود الديربي عشان يختصصر لك الووقت addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player, 255, 255, 0 ) end end ) عشان تجيب عدد نقاطك اكتب بأف8 MyPoints في السطر 3 تقول بدلها بالاعب الي فاز زش تقصد Link to comment
iMr.WiFi..! Posted July 22, 2017 Share Posted July 22, 2017 Just now, MARIY said: في السطر 3 تقول بدلها بالاعب الي فاز زش تقصد انت روح لمود الديربي ودور عند لما اللاعب يفوز وبدلها بالسطر الثالث Link to comment
Adham Posted July 23, 2017 Share Posted July 23, 2017 بسيطه, مصري سوي اول م يفوز اللاعب في مود الديربي عطيه نقاط زي م بتعطيه فلوس او م يفوز لو مو عرفت اطرح اكوادك وإنشاء الله بساعدك. Link to comment
MA[S]RIY Posted July 23, 2017 Author Share Posted July 23, 2017 انا بعدل علي قيم مود الريس وذ الكود حق لما يفوز DestructionDerby = setmetatable({}, RaceMode) DestructionDerby.__index = DestructionDerby DestructionDerby:register('Destruction derby') function DestructionDerby:isApplicable() return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' end function DestructionDerby:getPlayerRank(player) return #getActivePlayers() end -- Copy of old updateRank function DestructionDerby:updateRanks() for i,player in ipairs(g_Players) do if not isPlayerFinished(player) then local rank = self:getPlayerRank(player) if not rank or rank > 0 then setElementData(player, 'race rank', rank) end end end -- Make text look good at the start if not self.running then for i,player in ipairs(g_Players) do setElementData(player, 'race rank', '' ) setElementData(player, 'checkpoint', '' ) end end end function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() else TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end end RaceMode.setPlayerIsFinished(player) showBlipsAttachedTo(player, false) end function DestructionDerby:onPlayerQuit(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() end end end function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = RankingBoard:create() self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) end local timePassed = self:getTimePassed() self.rankingBoard:add(player, timePassed) -- Do remove local rank = self:getPlayerRank(player) finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end ------------------------------------------------------------ -- activePlayerList stuff -- function isActivePlayer( player ) return table.find( g_CurrentRaceMode.activePlayerList, player ) end function addActivePlayer( player ) table.insertUnique( g_CurrentRaceMode.activePlayerList, player ) end function removeActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) end function finishActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) table.insertUnique( g_CurrentRaceMode.finishedPlayerList, _getPlayerName(player) ) end function getFinishedPlayerCount() return #g_CurrentRaceMode.finishedPlayerList end function getActivePlayerCount() return #g_CurrentRaceMode.activePlayerList end function getActivePlayers() return g_CurrentRaceMode.activePlayerList end هيه دي الاكواد Link to comment
iMr.WiFi..! Posted July 24, 2017 Share Posted July 24, 2017 20 hours ago, MARIY said: انا بعدل علي قيم مود الريس وذ الكود حق لما يفوز DestructionDerby = setmetatable({}, RaceMode) DestructionDerby.__index = DestructionDerby DestructionDerby:register('Destruction derby') function DestructionDerby:isApplicable() return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' end function DestructionDerby:getPlayerRank(player) return #getActivePlayers() end -- Copy of old updateRank function DestructionDerby:updateRanks() for i,player in ipairs(g_Players) do if not isPlayerFinished(player) then local rank = self:getPlayerRank(player) if not rank or rank > 0 then setElementData(player, 'race rank', rank) end end end -- Make text look good at the start if not self.running then for i,player in ipairs(g_Players) do setElementData(player, 'race rank', '' ) setElementData(player, 'checkpoint', '' ) end end end function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() else TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end end RaceMode.setPlayerIsFinished(player) showBlipsAttachedTo(player, false) end function DestructionDerby:onPlayerQuit(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() end end end function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = RankingBoard:create() self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) end local timePassed = self:getTimePassed() self.rankingBoard:add(player, timePassed) -- Do remove local rank = self:getPlayerRank(player) finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end ------------------------------------------------------------ -- activePlayerList stuff -- function isActivePlayer( player ) return table.find( g_CurrentRaceMode.activePlayerList, player ) end function addActivePlayer( player ) table.insertUnique( g_CurrentRaceMode.activePlayerList, player ) end function removeActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) end function finishActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) table.insertUnique( g_CurrentRaceMode.finishedPlayerList, _getPlayerName(player) ) end function getFinishedPlayerCount() return #g_CurrentRaceMode.finishedPlayerList end function getActivePlayerCount() return #g_CurrentRaceMode.activePlayerList end function getActivePlayers() return g_CurrentRaceMode.activePlayerList end هيه دي الاكواد مافيه كود فوز اللاعب هنا .. Link to comment
MA[S]RIY Posted July 24, 2017 Author Share Posted July 24, 2017 3 hours ago, iMr.WiFi..! said: مافيه كود فوز اللاعب هنا .. بص هو لما العب بيفوز بتطلع الرساله دي showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز الي هيه في السطر 75 Link to comment
MA[S]RIY Posted July 24, 2017 Author Share Posted July 24, 2017 5 hours ago, MARIY said: بص هو لما العب بيفوز بتطلع الرساله دي showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز الي هيه في السطر 75 @iMr.WiFi..! Link to comment
iMr.WiFi..! Posted July 24, 2017 Share Posted July 24, 2017 بدل الكود بـ ذا local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint", getAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint" ) ) end triggerEvent( "onPlayerWinDD",activePlayers[1] ) end Link to comment
MA[S]RIY Posted July 24, 2017 Author Share Posted July 24, 2017 يعني الكود هيبقا كدا صح ؟ local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint", getAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint" ) ) end triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player, 255, 255, 0 ) end end ) Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 14 hours ago, MARIY said: يعني الكود هيبقا كدا صح ؟ local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- هيه دي الرساله الي بتطلع للكل لما واحد يفوز if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint", getAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint" ) ) end triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player, 255, 255, 0 ) end end ) اخوي انا كسبت اكثر من مره واكتب ماي بوينت يطلع بالشات يور بيونت 0 انا مو شايف +1 في الكود خالص كيف بيعطي نقطه ؟ @iMr.WiFi..! Link to comment
iMr.WiFi..! Posted July 25, 2017 Share Posted July 25, 2017 دقايق غلطت بدل سطر 7 setAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint", getAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint" ) + 1) Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 1 hour ago, iMr.WiFi..! said: دقايق غلطت بدل سطر 7 setAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint", getAccountData ( getPlayerAccount ( activePlayers[1] ), "DerbyPoint" ) + 1) @iMr.WiFi.. م اشتغل وطلع لي بالدي بق Link to comment
Mhmd.z Posted July 25, 2017 Share Posted July 25, 2017 9 minutes ago, MARIY said: @iMr.WiFi.. م اشتغل وطلع لي بالدي بق setAccountData (getPlayerAccount (activePlayers[1]), "DerbyPoint", (getAccountData(getPlayerAccount (activePlayers[1]), "DerbyPoint") or 0) + 1) Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 53 minutes ago, Mhmd.z said: setAccountData (getPlayerAccount (activePlayers[1]), "DerbyPoint", (getAccountData(getPlayerAccount (activePlayers[1]), "DerbyPoint") or 0) + 1) طيب انشاء الله اخر شئ الحين الكود كذا local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) exports["TopBarChat"]:sendClientMessage ( "#Derby [".. ( getAccountData ( getPlayerAccount ( player ) , "DerbyPoint" ) or 0 ) .." ]عدد نقاطه", source,216, 139, 39 ,true) triggerEvent( "onPlayerWinDD",activePlayers[1] ) if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData (getPlayerAccount (activePlayers[1]), "DerbyPoint", (getAccountData(getPlayerAccount (activePlayers[1]), "DerbyPoint") or 0) + 1) end end end addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "#You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player,216, 139, 39 ,true) end end ) م يطلعلي اخطاء بالدي بق اشغل مود التوب بار شات المشكله بقا ان لما احد يكسب م يرضي يطلع النص حق exports["TopBarChat"]:sendClientMessage ( "#Derby [".. ( getAccountData ( getPlayerAccount ( player ) , "DerbyPoint" ) or 0 ) .." ]عدد نقاطه", source,216, 139, 39 ,true) وش المشكله ليش م يطلع النص Link to comment
Mhmd.z Posted July 25, 2017 Share Posted July 25, 2017 1 hour ago, MARIY said: طيب انشاء الله اخر شئ الحين الكود كذا local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) exports["TopBarChat"]:sendClientMessage ( "#Derby [".. ( getAccountData ( getPlayerAccount ( player ) , "DerbyPoint" ) or 0 ) .." ]عدد نقاطه", source,216, 139, 39 ,true) triggerEvent( "onPlayerWinDD",activePlayers[1] ) if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData (getPlayerAccount (activePlayers[1]), "DerbyPoint", (getAccountData(getPlayerAccount (activePlayers[1]), "DerbyPoint") or 0) + 1) end end end addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "#You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player,216, 139, 39 ,true) end end ) م يطلعلي اخطاء بالدي بق اشغل مود التوب بار شات المشكله بقا ان لما احد يكسب م يرضي يطلع النص حق exports["TopBarChat"]:sendClientMessage ( "#Derby [".. ( getAccountData ( getPlayerAccount ( player ) , "DerbyPoint" ) or 0 ) .." ]عدد نقاطه", source,216, 139, 39 ,true) وش المشكله ليش م يطلع النص كودك حق النص مااشوف فيه خطأ, المشكلة من الحدث يلي موجود فيه النص, اطرح الكود كامل Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 2 hours ago, Mhmd.z said: كودك حق النص مااشوف فيه خطأ, المشكلة من الحدث يلي موجود فيه النص, اطرح الكود كامل DestructionDerby = setmetatable({}, RaceMode) DestructionDerby.__index = DestructionDerby DestructionDerby:register('Destruction derby') function DestructionDerby:isApplicable() return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' end function DestructionDerby:getPlayerRank(player) return #getActivePlayers() end -- Copy of old updateRank function DestructionDerby:updateRanks() for i,player in ipairs(g_Players) do if not isPlayerFinished(player) then local rank = self:getPlayerRank(player) if not rank or rank > 0 then setElementData(player, 'race rank', rank) end end end -- Make text look good at the start if not self.running then for i,player in ipairs(g_Players) do setElementData(player, 'race rank', '' ) setElementData(player, 'checkpoint', '' ) end end end function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() else TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end end RaceMode.setPlayerIsFinished(player) showBlipsAttachedTo(player, false) end function DestructionDerby:onPlayerQuit(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() end end end function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = RankingBoard:create() self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) end local timePassed = self:getTimePassed() self.rankingBoard:add(player, timePassed) -- Do remove local rank = self:getPlayerRank(player) finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) exports["TopBarChat"]:sendClientMessage ( "#Derby [".. ( getAccountData ( getPlayerAccount ( player ) , "DerbyPoint" ) or 0 ) .." ]عدد نقاطه", source,216, 139, 39 ,true) triggerEvent( "onPlayerWinDD",activePlayers[1] ) if not isGuestAccount ( getPlayerAccount ( activePlayers[1] ) ) then setAccountData (getPlayerAccount (activePlayers[1]), "DerbyPoint", (getAccountData(getPlayerAccount (activePlayers[1]), "DerbyPoint") or 0) + 1) end end end addCommandHandler ( "MyPoints", function ( player ) if not isGuestAccount ( getPlayerAccount ( player ) ) then outputChatBox ( "#You'r point : ".. ( getAccountData ( getPlayerAccount ( player ), "DerbyPoint" ) or 0 ), player,216, 139, 39 ,true) end end ) ------------------------------------------------------------ -- activePlayerList stuff -- function isActivePlayer( player ) return table.find( g_CurrentRaceMode.activePlayerList, player ) end function addActivePlayer( player ) table.insertUnique( g_CurrentRaceMode.activePlayerList, player ) end function removeActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) end function finishActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) table.insertUnique( g_CurrentRaceMode.finishedPlayerList, _getPlayerName(player) ) end function getFinishedPlayerCount() return #g_CurrentRaceMode.finishedPlayerList end function getActivePlayerCount() return #g_CurrentRaceMode.activePlayerList end function getActivePlayers() return g_CurrentRaceMode.activePlayerList end ذا الكود كامل Link to comment
Mhmd.z Posted July 25, 2017 Share Posted July 25, 2017 عندك التحقق سطر 73 خطأ , جرب استبدله ب if getActivePlayerCount() == 1 then Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 (edited) ايه عرفت اخي وين المشكله المشكله اني كنت حاطط سورس والمفروض احط روت علشان يطلع للكل تمام الحين كيف اجيب عدد نقاطي في ليبل في لوحه اخر طلب Edited July 25, 2017 by MA[S]RIY Link to comment
Rockyz Posted July 25, 2017 Share Posted July 25, 2017 20 minutes ago, MARIY said: ايه عرفت اخي وين المشكله المشكله اني كنت حاطط سورس والمفروض احط روت علشان يطلع للكل تمام الحين كيف اجيب عدد نقاطي في ليبل في لوحه اخر طلب وش اخر طلب Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 6 minutes ago, #,+( _xiRoc[K]; > said: وش اخر طلب كيف اجيب النقط حقي بليبل بلوحه Link to comment
A7M8D Posted July 25, 2017 Share Posted July 25, 2017 تايمر و جيب الاكونت داتا و تراجر للكلاينت و حط فيه ليبل الاكاونت داتا Link to comment
MA[S]RIY Posted July 25, 2017 Author Share Posted July 25, 2017 طيب تمام اخ اخر شئ كيف اصفر النقاط حاولت كثير بس م عرفت ابي احد يقولي كيف اصفرها Link to comment
iMr.WiFi..! Posted July 25, 2017 Share Posted July 25, 2017 1 hour ago, MARIY said: طيب تمام اخ اخر شئ كيف اصفر النقاط حاولت كثير بس م عرفت ابي احد يقولي كيف اصفرها addCommandHandler ( "Zero", function ( player, cmd ) if not isGuestAccount ( getPlayerAccount( player ) ) then if isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount( player ) ), aclGetGroup ( "Console" ) ) then for i,v in ipairs ( getAccounts ( ) ) do if getAccountData ( v, "DerbyPoint" ) ~= 0 then setAccountData ( v, "DerbyPoint", 0 ) end end end end ) 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