Jump to content

x[ مساعدة ]x اضافة لاعبين في الجريد ليست عن طريق داتا


#RoLde

Recommended Posts

السلام عليكم

اليوم واجهتني مشكلة بكود اني اضيف لاعبين في جريد ليست

علي حسب الداتا حقتهم تكون اكثر من 1

وباقي اللاعبين يشوفوهم عادي بالجريد

وهذي محاولتي ومافي ديبق

function addWantedPlayers( )
guiGridListClear(wantedlist)
for i,player in ipairs ( getElementsByType("player") ) do
if getPlayerTeam(player) == "Priates" then
if getElementData(player, "WantedM") > 1 then
local row = guiGridListAddRow(wantedlist)
guiGridListSetItemText(wantedlist, row,1, getPlayerName(player), false, false)
guiGridListSetItemText(wantedlist, row,2, convertNumber(getElementData(player,"WantedM")), false, false)
guiGridListSetItemColor(wantedlist, row, 1, 255,0,0,255)
guiGridListSetItemColor(wantedlist, row, 1, 0,255,0,255)
end
end
end
end
addEventHandler("onClientPlayerChangeNick", root, addWantedPlayers)
addEventHandler("onClientResourceStart",root, addWantedPlayers)
addEventHandler("onClientPlayerJoin",root, addWantedPlayers)
addEventHandler("onClientPlayerQuit",root, addWantedPlayers)

bindKey("F2","down",
function( )
if ( guiGetVisible(wnd) == false ) then
guiSetVisible(wnd, true)
showCursor( true )
addWantedPlayers( )
else
guiSetVisible(wnd, false)
showCursor( false )
end
end
)

 

Link to comment
Just now, N3xT said:

تأكد من اسم الداتا والتيم

متأكد منها مليون بالمية

لاني لما شلت التيم والتحقق نفع

الغلط في تحقق التيم لان لما شلته اشتغل الكود

Link to comment
function addWantedPlayers( )
	guiGridListClear ( wantedlist )
	for i,player in ipairs ( getElementsByType ( "player" ) ) do
		local playerTeam = getPlayerTeam ( player )
		if ( playerTeam ) and ( getTeamName ( playerTeam ) ~= "Priates" ) then
			if ( ( getElementData ( player, "WantedM" ) or 0 ) > 1 ) then
				local row = guiGridListAddRow ( wantedlist )
				guiGridListSetItemText ( wantedlist, row, 1, getPlayerName ( player ), false, false )
				guiGridListSetItemText ( wantedlist, row, 2, convertNumber ( getElementData ( player,"WantedM" ) ), false, false )
				guiGridListSetItemColor ( wantedlist, row, 1, 255,0,0,255 )
				guiGridListSetItemColor ( wantedlist, row, 1, 0,255,0,255 )
			end
		end
	end
end
addEventHandler("onClientPlayerChangeNick", root, addWantedPlayers)
addEventHandler("onClientResourceStart", root, addWantedPlayers)
addEventHandler("onClientPlayerJoin", root, addWantedPlayers)
addEventHandler("onClientPlayerQuit", root, addWantedPlayers)

 

Edited by N3xT
Link to comment
5 minutes ago, N3xT said:

function addWantedPlayers( )
	guiGridListClear ( wantedlist )
	for i,player in ipairs ( getElementsByType ( "player" ) ) do
		local playerTeam = getPlayerTeam ( player )
		if ( playerTeam ) and ( getTeamName ( playerTeam ) == "Priates" ) then
			if ( getElementData ( player, "WantedM" ) > 1 ) then
				local row = guiGridListAddRow ( wantedlist )
				guiGridListSetItemText ( wantedlist, row, 1, getPlayerName ( player ), false, false )
				guiGridListSetItemText ( wantedlist, row, 2, convertNumber ( getElementData ( player,"WantedM" ) ), false, false )
				guiGridListSetItemColor ( wantedlist, row, 1, 255,0,0,255 )
				guiGridListSetItemColor ( wantedlist, row, 1, 0,255,0,255 )
			end
		end
	end
end
addEventHandler("onClientPlayerChangeNick", root, addWantedPlayers)
addEventHandle("onClientResourceStart", root, addWantedPlayers)
addEventHandler("onClientPlayerJoin", root, addWantedPlayers)
addEventHandler("onClientPlayerQuit", root, addWantedPlayers)

 

 

برضو مافي شي يظهر

Edited by N3xT
Link to comment

Pirates المشكلة كانت من البداية منك, الكود اللي فوق عدلته بحيث ان تيمك ماهو

واشتغل معاك, يعني المشكلة كانت باسم التيم, قلت لك تأكد منه

 

== استبدل =~ بـ

وتأكد من اسم التيم, الحرف الكبير ممكن المشكلة تكون منه

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