Jump to content

تصحيح كود


iyaad

Recommended Posts

 addEventHandler("onPlayerWasted", root,
function(_, killer)
local Team = getPlayerTeam ( killer )  
local count = #getAlivePlayersInTeam(Team) or 0
if count == 0 then
test1()
end
end );

مود توب حق تكتيك ما يخرج لما يموت التيم الأخر وش المشكلة 

 

ارجوالرد

Link to comment
3 minutes ago, xNawaf said:

وش تبي تسوي بالضبط؟

ابي انو أول ما يخلص القيم ( الماتج ) من جمب الشاشة للأفضل 5 لاعبين 

 

هو جهاز وكل شي يطلع بس المشكلة وقت خروجو ابيه يطلع لما تخلص الجولة

 

ممكن تصحيح الكود

Link to comment
Just now, iyaad said:

 addEventHandler("onPlayerWasted", root,
function(_, killer)
local Team = getPlayerTeam ( killer )  
local count = #getAlivePlayersInTeam(Team) or 0
if count == 0 then
test1()
end
end );

مود توب حق تكتيك ما يخرج لما يموت التيم الأخر وش المشكلة 

 

ارجوالرد

getAlivePlayersInTeam يوزفل فنكشن

هل انت مستعمل السورس كود حقها ؟

Link to comment
Just now, killerProject said:

getAlivePlayersInTeam يوزفل فنكشن

هل انت مستعمل السورس كود حقها ؟

يب حاط

function getAlivePlayersInTeam(theTeam)
    local theTable = { }
    local players = getPlayersInTeam(theTeam)

    for i,v in pairs(players) do
      if not isPedDead(v) then
        theTable[#theTable+1]=v
      end
    end
  
    return theTable
end

شوف

Link to comment
  • Scripting Moderators

جرب ذا الكود وكلمني
 

addEventHandler ("onRoundFinish",root,
function ()
	... -- والأكواد حقتك
	end
)

م يحتاج تسوي تحقق انه التيم مفيه احد حي , الحدث يوم ينتهي الماب

Link to comment
Just now, iyaad said:

يب حاط


function getAlivePlayersInTeam(theTeam)
    local theTable = { }
    local players = getPlayersInTeam(theTeam)

    for i,v in pairs(players) do
      if not isPedDead(v) then
        theTable[#theTable+1]=v
      end
    end
  
    return theTable
end

شوف

-- جرب ذذ
function wasted (_, killer)
	setPlayerTeam ( source , getTeamFromName ( "team2" ) or createTeam ( "team2", 255, 255, 255 ) )
	local count = #getAlivePlayersInTeam ( getPlayerTeam ( source ) ) or 0
	if count == 0 then
		test1()
	end
end

addEventHandler("onPlayerWasted", root, wasted )

 

Edited by killerProject
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...