Jump to content

تصحيح اكواد


Recommended Posts

انا مسوي لوحه بس لمن اكتب الامر ما تفتح اللوحه 

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        window1 = guiCreateWindow(509, 175, 311, 452, "Revive Panel", false)
        guiWindowSetSizable(window1, false)
		        guiSetVisible( window1 ,false)
        gridlist = guiCreateGridList(13, 26, 288, 341, false, window1)
        guiGridListAddColumn(gridlist, "Players", 0.9)
        Button1 = guiCreateButton(17, 379, 139, 63, "Revive Player", false, window1)
        Button2 = guiCreateButton(166, 379, 135, 63, "Close", false, window1) 
        guiGridListClear(gridlist)		
    end
)
addCommandHandler('rp',
function ()
guiSetVisible(window1,not guiSetVisible(window1))
showCursor(guiGetVisible(window1))
changeGridListToPlayersAround ( gridlist, 1, 5 )
end
)
addEventHandler ( "onClientGUIClick",root,
function ()  
if (source == Button2) then
guiSetVisible( window1 ,false)
showCursor(false)
   end
end
)
addEventHandler ( "onClientGUIClick",root,
function ()  
if (source == Button1) then
guiSetVisible( window1 ,false)
showCursor(false)
     setElementHealth ( player,100)
	 else
	 outputChatBox("Error", source, 255, 0, 0)
   end
end
)
function isElementInRange(ele, x, y, z, range)
	   if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then
		  return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -
	   end
	   return false
	end
	
	function changeGridListToPlayersAround ( gridlist, column, range )
  		if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist ) == 'gui-gridlist' then
    	guiGridListClear ( gridlist )
          for i,v in ipairs ( getElementsByType ( 'player' ) ) do
      		 if ( v == getLocalPlayer ( ) ) then
                return
        	end
              local x,y,z = getElementPosition ( localPlayer )
                  if isElementInRange ( v, x, y, z, range ) then
                      local row = guiGridListAddRow ( gridlist )
                      guiGridListSetItemText ( gridlist, row, column, getPlayerName ( v ), false, false )
				 end
  		end
		return true
		else
		return false
	end
end


function refreshgirdlist ()
       for _,v in ipairs ( getElementsByType ( "player" ) ) do 
       x,y,z = getElementPosition(localPlayer)
       x1,y1,z1 = getElementPosition(v)
       Distance = getDistanceBetweenPoints3D (x,y,z,x1,y1,z1)
       if Distance <= 50 then 
 
 end 

 

Link to comment
12 hours ago, MR.StoRm said:

-_-"

يصير كذا :
 


guiSetVisible(window1,not guiGetVisible(window1))

 

طيب وش الجدييد كتبتها نفسها

جرب داا

addCommandHandler('rp',
function ()
if guiGetVisible( window1 ) then
     guiSetVisible( window1, false )
     showCursor(false)
else
     guiSetVisible( window1, true )
     showCursor(true)
changeGridListToPlayersAround ( gridlist, 1, 5 )
end
end
)

 

  • Haha 1
  • Confused 1
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...