Jump to content

dxdrawText


Recommended Posts

getElementDimension خرب كل شي


--countdown
local sX,sY = guiGetScreenSize() 
local counter = 60 
local r,g,b = 0,255,0 
local timeTable = {}; 
  
function res(Res) 
	outputChatBox ( "#FB00FF• #ffffffTeam Deathmatch #FB00FFevent will start in 60 seconds !",255, 255, 255, true) 
addEventHandler("onClientRender",root,draw) 
end 
addEventHandler("onClientResourceStart", getRootElement(), res) 
  
function draw() 
    if getElementDimension  == 1 then 
    dxDrawText("Event starts in:",0,sY*0.07,sX,sY,tocolor(255,255,255,255),1.5,"bankgothic","center","top",false,false,false) 
	dxDrawText(counter,0,sY*0.15,sX,sY,tocolor(r,g,b,255),3,"bankgothic","center","top",false,false,false) 
end 
removeEventHandler("onClientRender", root, draw) 
  
  
timer = setTimer(function() 
    counter = counter - 1 
    if counter < 0 then 
        counter = 60
        r,g,b = 255,255,255
    end 
    if counter <= 30 then 
        r,g,b = 255,255,0 
    end 
	if counter <= 10 then 
        r,g,b = 255,0,0 
    end 
    if counter == 0 then 
	removeEventHandler("onClientRender", root, draw) 
    for i,v in ipairs(getElementsByType("player")) do  
	outputChatBox ( "#FB00FF• #ffffffTeam Deathmatch #FB00FFevent started !",255, 255, 255, true) 
    if isTimer(timer) then killTimer(timer) end 
    if isTimer(timer2)  then killTimer(timer2) end 
    end 
    end 
end,1000,0) 
  

 

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

getElementDimension خرب كل شي


--gui
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
local screenW,screenH = guiGetScreenSize()
weaponWind = guiCreateWindow((screenW - 646) / 2, (screenH - 213) / 2, 646, 213, "Weapons", false)
guiWindowSetSizable(weaponWind, false)
guiSetVisible(weaponWind,false)
GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 167, 138, false, weaponWind)
guiGridListAddColumn(GUIEditor.gridlist[1], "Machine guns", 0.9)
for i = 1, 2 do
    guiGridListAddRow(GUIEditor.gridlist[1])
end
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "M4A1", false, false)
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "AK-47", false, false)
GUIEditor.gridlist[2] = guiCreateGridList(228, 22, 167, 138, false, weaponWind)
guiGridListAddColumn(GUIEditor.gridlist[2], "Sub-machine guns", 0.9)
for i = 1, 3 do
    guiGridListAddRow(GUIEditor.gridlist[2])
end
guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "MP7", false, false)
guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "MP5", false, false)
guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "G18", false, false)
GUIEditor.gridlist[3] = guiCreateGridList(455, 22, 167, 138, false, weaponWind)
guiGridListAddColumn(GUIEditor.gridlist[3], "Shotguns", 0.9)
for i = 1, 3 do
    guiGridListAddRow(GUIEditor.gridlist[3])
end
guiGridListSetItemText(GUIEditor.gridlist[3], 0, 1, "Model 1887", false, false)
guiGridListSetItemText(GUIEditor.gridlist[3], 1, 1, "Striker", false, false)
guiGridListSetItemText(GUIEditor.gridlist[3], 2, 1, "SPAZ-12", false, false)
Close_BTN5 = guiCreateButton(215, 173, 190, 30, "Close", false, weaponWind)
-- functions

function OpenWindow1(source)
    if ( getElementDimension ( localPlayer ) == 0 ) then
		outputChatBox ( "#FB00FF• You can't select weapons outside the event",255, 255, 255, true) 
		return end
if removeEventHandler("onClientRender",root,Lou) then  
removeEventHandler("onClientRender",root,Lou)
guiSetVisible ( weaponWind, false )
showCursor(false) 
else
addEventHandler("onClientRender",root,Lou) 
guiSetVisible ( weaponWind, true )
showCursor(true)
    end
end
addCommandHandler ( "select", OpenWindow1 )

addEventHandler("onClientGUIClick",root,
function()
if source == Close_BTN5 then
guiSetVisible(weaponWind,false) showCursor(false)
end
end
)
--countdown
local sX,sY = guiGetScreenSize() 
local counter = 60 
local r,g,b = 0,255,0 
local timeTable = {}; 
  
function res(Res) 
	outputChatBox ( "#FB00FF• #ffffffTeam Deathmatch #FB00FFevent will start in 60 seconds !",255, 255, 255, true) 
addEventHandler("onClientRender",root,draw) 
end 
addEventHandler("onClientResourceStart", getRootElement(), res) 
  
function draw() 
    if getElementDimension  == 1 then 
    dxDrawText("Event starts in:",0,sY*0.07,sX,sY,tocolor(255,255,255,255),1.5,"bankgothic","center","top",false,false,false) 
	dxDrawText(counter,0,sY*0.15,sX,sY,tocolor(r,g,b,255),3,"bankgothic","center","top",false,false,false) 
end 
removeEventHandler("onClientRender", root, draw) 
  
  
timer = setTimer(function() 
    counter = counter - 1 
    if counter < 0 then 
        counter = 60
        r,g,b = 255,255,255
    end 
    if counter <= 30 then 
        r,g,b = 255,255,0 
    end 
	if counter <= 10 then 
        r,g,b = 255,0,0 
    end 
    if counter == 0 then 
	removeEventHandler("onClientRender", root, draw) 
    for i,v in ipairs(getElementsByType("player")) do  
	outputChatBox ( "#FB00FF• #ffffffTeam Deathmatch #FB00FFevent started !",255, 255, 255, true) 
    if isTimer(timer) then killTimer(timer) end 
    if isTimer(timer2)  then killTimer(timer2) end 
    end 
    end 
end,1000,0) 
  

 

في end ناقصة

Link to comment

نفس الشي

function draw() 
    if ( getElementDimension == 0 ) then
    dxDrawText("Event starts in:",0,sY*0.07,sX,sY,tocolor(255,255,255,255),1.5,"bankgothic","center","top",false,false,false) 
	dxDrawText(counter,0,sY*0.15,sX,sY,tocolor(r,g,b,255),3,"bankgothic","center","top",false,false,false) 
end 
end
removeEventHandler("onClientRender", root, draw) 

 

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