Jump to content

Black2

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by Black2

  1. How put velocity to hit mark ? Example:Player in vehicle hit mark only below of 50mph ?,Player have 51mph can't hit mark.
  2. Hello,How set max ammo for weapon ?
  3. Black2

    [HELP]Event

    Hello,I created a resource team to give the player as I do to give team when playing "REGISTER" ?
  4. Hello,I got this script it will not let the team shoot but when it leaves the team still not shooting anyone could fix? Thx. teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = false } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) end else toggleControl ("fire", true) toggleControl ("aim_weapon", true) toggleControl ("vehicle_fire", true) end end setTimer(checkPlayerInTeam, 1000, 0 ) -- every second it will check if you are in team.
  5. How put command only for admin ? I could already do this, but this time I'm not getting. I managed to do it this way,I do exactly the same but nothing happens. "Admin"> "command.command" access="true"> "Default"> "command.command" access="false">
  6. Hello,I was wondering how do I not shoot team. I have this teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = true } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl("fire", false); end else toggleControl("fire", true); end end setTimer(checkPlayerInTeam, 5000, 0 ) -- every second it will check if you are in team. When you enter the team he did not shoot but when it comes out still not firing,how do I get out when he comes back to shoot ?
  7. Hello,Could someone tell me in detail as I do for a cylinder does not open in a high location or below? I wanted him to open only in the cylinder location. I know I have to use this code but do not know where will be that someone could help me putting on my script.thx Code local _, _, Pz = getElementPosition(player) local _, _, Mz = getElementPosition(marker) if Mz + 3 >= Pz and Pz >= Mz - 1 then -- Your code end My script (Lua) GUIEditor = { window = {}, staticimage = {}, label = {}, button = {}, progressbar = {} } wepgui = guiCreateWindow(290, 135, 446, 417, "Illegal Weapon Factory", false) guiWindowSetSizable(wepgui, false) guiSetVisible(wepgui, false) GUIEditor.staticimage[1] = guiCreateStaticImage(17, 47, 79, 71, ":[Lock]WeaponFactory/images/GRENADE.png", false, wepgui) GUIEditor.staticimage[2] = guiCreateStaticImage(17, 162, 79, 70, ":[Lock]WeaponFactory/images/TEC9.png", false, wepgui) GUIEditor.staticimage[3] = guiCreateStaticImage(17, 284, 79, 71, ":[Lock]WeaponFactory/images/SNIPER.png", false, wepgui) GUIEditor.label[1] = guiCreateLabel(123, 65, 313, 32, "Drag and click on the weapon that you want to create.", false, wepgui) GUIEditor.label[2] = guiCreateLabel(123, 172, 313, 32, "Drag and click on the weapon that you want to create.", false, wepgui) GUIEditor.label[3] = guiCreateLabel(123, 294, 313, 32, "Drag and click on the weapon that you want to create.", false, wepgui) GUIEditor.label[4] = guiCreateLabel(213, 113, 253, 32, "700$", false, wepgui) GUIEditor.label[5] = guiCreateLabel(213, 214, 253, 32, "200$", false, wepgui) GUIEditor.label[6] = guiCreateLabel(217, 336, 253, 32, "400$", false, wepgui) GUIEditor.label[7] = guiCreateLabel(59, 378, 383, 36, "NOTICE: TEC-9:100 Bullets/Grenade:8 Grenades/Sniper: 50 Bullets.", false, wepgui) GUIEditor.progressbar = guiCreateProgressBar(319, 285, 410, 59, false) GUIEditor.button[1] = guiCreateButton(404, 27, 22, 20, "X", false, wepgui) guiSetVisible(GUIEditor.progressbar, false) wepMarker1 = createMarker(2551.08, -1283.81, 1043, "cylinder", 2, 200, 0, 0, 50) wepMarker2 = createMarker(2543.13, -1283.69, 1043, "cylinder", 2, 200, 0, 0, 50) wepMarker3 = createMarker(2559.19, -1283.83, 1043, "cylinder", 2, 200, 0, 0, 50) setElementDimension(wepMarker1, 1) setElementInterior(wepMarker1, 2) setElementDimension(wepMarker2, 1) setElementInterior(wepMarker2, 2) setElementDimension(wepMarker3, 1) setElementInterior(wepMarker3, 2) function Towjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(wepgui) then local team = getPlayerTeam(hitElement) local theTeamName = getTeamName(team) if ( theTeamName == "Criminal" )then guiSetVisible(wepgui, true) showCursor(true) else triggerServerEvent("Box11", hitElement) guiSetVisible(wepgui, false) showCursor(false) end end end end addEventHandler("onClientMarkerHit", wepMarker1, Towjob) addEventHandler("onClientMarkerHit", wepMarker2, Towjob) addEventHandler("onClientMarkerHit", wepMarker3, Towjob) function Towjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(wepgui) then guiSetVisible(wepgui, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", wepMarker1, Towjobleave) addEventHandler("onClientMarkerLeave", wepMarker2, Towjobleave) addEventHandler("onClientMarkerLeave", wepMarker3, Towjobleave) addEventHandler("onClientGUIClick", GUIEditor.staticimage[1], function () progress = guiProgressBarGetProgress() guiSetVisible(wepgui, false) guiSetVisible(GUIEditor.progressbar, true) local lol = guiProgressBarGetProgress(GUIEditor.progressbar) setTimer( guiProgressBarSetProgress, 5000, 1,GUIEditor.progressbar,lol+10 ) setTimer( guiProgressBarSetProgress, 10000, 1,GUIEditor.progressbar,lol+20 ) setTimer( guiProgressBarSetProgress, 15000, 1,GUIEditor.progressbar,lol+30 ) setTimer( guiProgressBarSetProgress, 20000, 1,GUIEditor.progressbar,lol+40 ) setTimer( guiProgressBarSetProgress, 25000, 1,GUIEditor.progressbar,lol+50 ) setTimer( guiProgressBarSetProgress, 30000, 1,GUIEditor.progressbar,lol+60 ) setTimer( guiProgressBarSetProgress, 35000, 1,GUIEditor.progressbar,lol+70 ) setTimer( guiProgressBarSetProgress, 40000, 1,GUIEditor.progressbar,lol+80 ) setTimer( guiProgressBarSetProgress, 45000, 1,GUIEditor.progressbar,lol+90 ) setTimer( guiProgressBarSetProgress, 50000, 1,GUIEditor.progressbar,lol+100 ) triggerServerEvent("Box", localPlayer) timer = setTimer( function () triggerServerEvent("AK47", localPlayer) guiSetVisible(GUIEditor.progressbar, false) showCursor(false) guiProgressBarSetProgress(GUIEditor.progressbar, 0) end, 50000,1) end) addEventHandler("onClientGUIClick", GUIEditor.button[1], function () guiSetVisible(wepgui, false) showCursor(false) end) addEventHandler("onClientGUIClick", GUIEditor.staticimage[2], function () progress = guiProgressBarGetProgress() guiSetVisible(wepgui, false) guiSetVisible(GUIEditor.progressbar, true) local lol = guiProgressBarGetProgress(GUIEditor.progressbar) setTimer( guiProgressBarSetProgress, 5000, 1,GUIEditor.progressbar,lol+10 ) setTimer( guiProgressBarSetProgress, 10000, 1,GUIEditor.progressbar,lol+20 ) setTimer( guiProgressBarSetProgress, 15000, 1,GUIEditor.progressbar,lol+30 ) setTimer( guiProgressBarSetProgress, 20000, 1,GUIEditor.progressbar,lol+40 ) setTimer( guiProgressBarSetProgress, 25000, 1,GUIEditor.progressbar,lol+50 ) setTimer( guiProgressBarSetProgress, 30000, 1,GUIEditor.progressbar,lol+60 ) setTimer( guiProgressBarSetProgress, 35000, 1,GUIEditor.progressbar,lol+70 ) setTimer( guiProgressBarSetProgress, 40000, 1,GUIEditor.progressbar,lol+80 ) setTimer( guiProgressBarSetProgress, 45000, 1,GUIEditor.progressbar,lol+90 ) setTimer( guiProgressBarSetProgress, 50000, 1,GUIEditor.progressbar,lol+100 ) triggerServerEvent("Box10", localPlayer) timer = setTimer( function () triggerServerEvent("TEC9", localPlayer) guiSetVisible(GUIEditor.progressbar, false) showCursor(false) guiProgressBarSetProgress(GUIEditor.progressbar, 0) end, 50000,1) end) addEventHandler("onClientGUIClick", GUIEditor.staticimage[3], function () progress = guiProgressBarGetProgress() guiSetVisible(wepgui, false) guiSetVisible(GUIEditor.progressbar, true) local lol = guiProgressBarGetProgress(GUIEditor.progressbar) setTimer( guiProgressBarSetProgress, 5000, 1,GUIEditor.progressbar,lol+10 ) setTimer( guiProgressBarSetProgress, 10000, 1,GUIEditor.progressbar,lol+20 ) setTimer( guiProgressBarSetProgress, 15000, 1,GUIEditor.progressbar,lol+30 ) setTimer( guiProgressBarSetProgress, 20000, 1,GUIEditor.progressbar,lol+40 ) setTimer( guiProgressBarSetProgress, 25000, 1,GUIEditor.progressbar,lol+50 ) setTimer( guiProgressBarSetProgress, 30000, 1,GUIEditor.progressbar,lol+60 ) setTimer( guiProgressBarSetProgress, 35000, 1,GUIEditor.progressbar,lol+70 ) setTimer( guiProgressBarSetProgress, 40000, 1,GUIEditor.progressbar,lol+80 ) setTimer( guiProgressBarSetProgress, 45000, 1,GUIEditor.progressbar,lol+90 ) setTimer( guiProgressBarSetProgress, 50000, 1,GUIEditor.progressbar,lol+100 ) triggerServerEvent("Box9", localPlayer) timer = setTimer( function () triggerServerEvent("Sniper", localPlayer) guiSetVisible(GUIEditor.progressbar, false) showCursor(false) guiProgressBarSetProgress(GUIEditor.progressbar, 0) end, 50000,1) end) --// Setting local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( wepMarker1 ); local x2, y2, z2 = getElementPosition ( wepMarker2 ); local x3, y3, z3 = getElementPosition ( wepMarker3 ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local distance_3 = getDistanceBetweenPoints3D( x, y, z, x3, y3, z3 ); -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- end -- Marker #2 elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then -- local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- end -- Marker #3 elseif distance_3 <= gMaxDistance then local x3_, y3_ = getScreenFromWorldPosition( x3, y3, z3 + 0.95, 0.06 ); if x3_ and y3_ then -- local scale = 1 / ( gScale * ( distance_3 / gMaxDistance ) ); local alpha = ( ( distance_3 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- end end end ); -- //////////////////////////////////
  8. Hello,I was wondering how do I not receive team shot damage,but continue to receive other types of damage.Thx
  9. I was wondering how to do some teams not shoot.Thanks in advance
  10. Hello, I wonder how can I put god mode in a team.Thx
  11. Could someone tell me in detail as I do for a cylinder does not open in a high location or below? I wanted him to open only in the cylinder location.Thx
  12. Hello,I was wondering how do I a brand that is on the floor not open in another altitude. Example: The mark is in (z 100) It is opening in the same place only in (Z 1000) How I fix that to abir only (z 100).
  13. Hello,I created a resource and He opens a window When you enter into a cylinder, This window is in dimension 1 but can open it from other dimensions as I fix this? Thx
  14. Hello,How to set the time to use the command again? Example:I used a command and to use again only after 1 minute. Thx
  15. Hello,I created a window that opens with command, I would like to know how do I open it when in a cylinder. Can someone help me? Thx.
  16. Hello, I I downloaded a script Here in Communidade MTA made by Crazy,This script has a bar to enter and this bar if you type the letter "T" opens the chat I would love it if some of you could help me Thx.Sorry Bad English I do not understand almost anything moon so I was wondering how can I do to not open the chat when you type the letter "T",Thx Again. Client nilSound = { ["meta"] = {}, ["length"] = 0, ["pointer"] = nil, ["stream_title"] = nil, ["url"] = nil, ["row"] = nil } currentSound = nilSound function soundStarted(success,length,streamName) if success then currentSound.pointer = source currentSound.meta = getSoundMetaTags(source) currentSound.length = length if length == 0 then outputChatBox('#FFFF00RADIO: #FFFFFF"'..streamName..'" stream started.',255,0,0,true) if currentSound.meta.title then outputChatBox('#000000*#FFFF00Title: #FFFFFF"'..currentSound.meta.title,255,0,0,true) end if currentSound.meta.artist then outputChatBox('#000000*#FFFF00Artist: #FFFFFF"'..currentSound.meta.artist,255,0,0,true) end if currentSound.meta.stream_name then outputChatBox('#000000*#FFFF00Stream name: #FFFFFF"'..currentSound.meta.stream_name,255,0,0,true) end if currentSound.meta.stream_title then outputChatBox('#000000*#FFFF00Stream title: #FFFFFF"'..currentSound.meta.stream_title,255,0,0,true) elseif currentSound.stream_title then outputChatBox('#000000*#FFFF00Stream title: #FFFFFF"'..currentSound.stream_title,255,0,0,true) end else outputChatBox("*********************************",0,0,0) --[[if currentSound.meta.title then outputChatBox('#FFFF00RADIO: #FFFFFF"'..currentSound.meta.title..'" sound started.',255,0,0,true) else outputChatBox('#FFFF00RADIO: #FFFFFFSound started.',255,0,0,true) end]]-- if currentSound.meta.title then outputChatBox('#000000*#FFFF00Title: #FFFFFF'..currentSound.meta.title,255,0,0,true) end if currentSound.meta.artist then outputChatBox('#000000*#FFFF00Artist: #FFFFFF'..currentSound.meta.artist,255,0,0,true) end outputChatBox('#000000*#FFFF00Length: #FFFFFF'..tostring(getRealTime(length/1000).minute)..":"..tostring(getRealTime(length/1000).second),255,0,0,true) outputChatBox("*********************************",0,0,0) end else outputChatBox("#FFFF00RADIO: #FFFFFFFailed to play sound/stream.",255,0,0,true) end end function startSound(url,row) outputChatBox("#FFFF00RADIO: #FFFFFFTrying to play "..url,255,0,0,true) if currentSound.pointer then stopSound(currentSound.pointer) end currentSound = nilSound currentSound.url = url if row then currentSound.row = row end playSound(url) end function onSoundStop() if currentSound.length ~= 0 then if guiCheckBoxGetSelected(GUIEditor_Checkbox[2]) == true then startSound(currentSound.url) else if guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) == true then local totalSounds = guiGridListGetRowCount(GUIEditor_Grid[2]) - 1 if currentSound.row + 1 > totalSounds then startSound(guiGridListGetItemText(GUIEditor_Grid[2],0,soundColumn),0) else startSound(guiGridListGetItemText(GUIEditor_Grid[2],totalSounds,soundColumn),currentSound.row + 1) end else currentSound = nilSound end end else currentSound = nilSound outputChatBox("#FFFF00RADIO: #FFFFFFStream stopped.",255,0,0,true) end end function onSoundChange(title) currentSound.meta = getSoundMetaTags(source) currentSound.stream_title = title if currentSound.stream_title then outputChatBox("#FFFF00RADIO: #FFFFFFNow playing "..currentSound.stream_title,255,0,0,true) else outputChatBox("#FFFF00RADIO: #FFFFFFNow playing "..currentSound.url,255,0,0,true) end outputChatBox("*********************************",0,0,0) if currentSound.meta.title then outputChatBox('#000000*#FFFF00Title: #FFFFFF"'..currentSound.meta.title,255,0,0,true) end if currentSound.meta.artist then outputChatBox('#000000*#FFFF00Artist: #FFFFFF"'..currentSound.meta.artist,255,0,0,true) end if currentSound.meta.stream_name then outputChatBox('#000000*#FFFF00Stream name: #FFFFFF"'..currentSound.meta.stream_name,255,0,0,true) end if currentSound.meta.stream_title then outputChatBox('#000000*#FFFF00Stream title: #FFFFFF"'..currentSound.meta.stream_title,255,0,0,true) elseif currentSound.stream_title then outputChatBox('#000000*#FFFF00Stream title: #FFFFFF"'..currentSound.stream_title,255,0,0,true) end outputChatBox("*********************************",0,0,0) end --Controls start addCommandHandler("vol_up", function () if currentSound.pointer then local curVolume = getSoundVolume(currentSound.pointer) if curVolume < 1 then setSoundVolume(currentSound.pointer,curVolume+0.1) else setSoundVolume(currentSound.pointer,1) end end end) addCommandHandler("vol_down", function () if currentSound.pointer then local curVolume = getSoundVolume(currentSound.pointer) if curVolume > 0 then setSoundVolume(currentSound.pointer,curVolume-0.1) else setSoundVolume(currentSound.pointer,0) end end end) addCommandHandler("stopsound", function () if currentSound.pointer then stopSound(currentSound.pointer) currentSound = nilSound outputChatBox("#FFFF00RADIO: #FFFFFFSound stopped ",255,0,0,true) end end) --Controls end --Events start addEventHandler("onClientSoundStream",getResourceRootElement(getThisResource()),soundStarted) addEvent("onClientSoundStop",false) setTimer( function () if currentSound.pointer then if currentSound.length ~= 0 then if getSoundPosition(currentSound.pointer) == 0 then triggerEvent("onClientSoundStop",currentSound.pointer) end else if getSoundPosition(currentSound.pointer) == 0 then triggerEvent("onClientSoundStop",currentSound.pointer) end end end end,1000,0) addEventHandler("onClientSoundStop",getResourceRootElement(getThisResource()),onSoundStop) addEventHandler("onClientSoundChangedMeta",getResourceRootElement(getThisResource()),onSoundChange) Client gui screenX,screenY=guiGetScreenSize() function loadStreamAndSoundList() local streams = xmlLoadFile("streams.xml") if not streams then streams = xmlCreateFile("streams.xml","streams") xmlSaveFile(streams) end local sounds = xmlLoadFile("sounds.xml") if not sounds then sounds = xmlCreateFile("sounds.xml","sounds") xmlSaveFile(sounds) end local streamNodes = xmlNodeGetChildren(streams) local soundNodes = xmlNodeGetChildren(sounds) for i,v in ipairs(streamNodes) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,streamColumn,xmlNodeGetValue(v),false,false) end for i,v in ipairs(soundNodes) do local row = guiGridListAddRow(GUIEditor_Grid[2]) guiGridListSetItemText(GUIEditor_Grid[2],row,soundColumn,xmlNodeGetValue(v),false,false) end xmlUnloadFile(streams) xmlUnloadFile(sounds) end function updateStreamAndSoundList() local streams = xmlCreateFile("streams.xml","streams") xmlSaveFile(streams) local sounds = xmlCreateFile("sounds.xml","sounds") xmlSaveFile(sounds) local totalStreams = guiGridListGetRowCount(GUIEditor_Grid[1]) local totalSounds = guiGridListGetRowCount(GUIEditor_Grid[2]) for i=0,totalStreams-1 do xmlNodeSetValue(xmlCreateChild(streams,"url"),guiGridListGetItemText(GUIEditor_Grid[1],i,streamColumn)) end for i=0,totalSounds-1 do xmlNodeSetValue(xmlCreateChild(sounds,"url"),guiGridListGetItemText(GUIEditor_Grid[2],i,soundColumn)) end xmlSaveFile(streams) xmlSaveFile(sounds) xmlUnloadFile(streams) xmlUnloadFile(sounds) end function loadGUI() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.1895,0.2396,0.6455,0.5078,"Sound & Radio Player",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_TabPanel[1] = guiCreateTabPanel(0.0136,0.0641,0.9728,0.9128,true,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Streams",GUIEditor_TabPanel[1]) GUIEditor_Grid[1] = guiCreateGridList(0.0124,0.0361,0.4557,0.9367,true,GUIEditor_Tab[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) streamColumn = guiGridListAddColumn(GUIEditor_Grid[1],"URL",0.9) GUIEditor_Label[1] = guiCreateLabel(0.4806,0.0572,0.2799,0.0693,"Add stream",true,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(0.4774,0.1386,0.1711,0.0542,"URL:",true,GUIEditor_Tab[1]) GUIEditor_Edit[1] = guiCreateEdit(0.5879,0.1295,0.3919,0.0693,"",true,GUIEditor_Tab[1]) GUIEditor_Button[1] = guiCreateButton(0.591,0.2319,0.3872,0.0753,"Add stream",true,GUIEditor_Tab[1]) GUIEditor_Label[3] = guiCreateLabel(0.4759,0.3584,0.1322,0.0542,"Remove",true,GUIEditor_Tab[1]) GUIEditor_Button[2] = guiCreateButton(0.591,0.4277,0.3872,0.0753,"Remove stream",true,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Sounds",GUIEditor_TabPanel[1]) GUIEditor_Grid[2] = guiCreateGridList(0.0124,0.0361,0.4557,0.9367,true,GUIEditor_Tab[2]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) soundColumn = guiGridListAddColumn(GUIEditor_Grid[2],"URL",0.9) GUIEditor_Checkbox[1] = guiCreateCheckBox(0.4821,0.1386,0.3157,0.0633,"Radio mode",false,true,GUIEditor_Tab[2]) GUIEditor_Label[4] = guiCreateLabel(0.4821,0.0693,0.1851,0.0542,"Settings",true,GUIEditor_Tab[2]) GUIEditor_Checkbox[2] = guiCreateCheckBox(0.4821,0.2139,0.1882,0.0602,"Repeat sound",false,true,GUIEditor_Tab[2]) GUIEditor_Label[5] = guiCreateLabel(0.4883,0.3072,0.1649,0.0512,"Add sound",true,GUIEditor_Tab[2]) GUIEditor_Label[6] = guiCreateLabel(0.4883,0.3976,0.1477,0.0753,"URL:",true,GUIEditor_Tab[2]) GUIEditor_Edit[2] = guiCreateEdit(0.591,0.3916,0.3919,0.0753,"",true,GUIEditor_Tab[2]) GUIEditor_Button[3] = guiCreateButton(0.591,0.488,0.395,0.0723,"Add sound",true,GUIEditor_Tab[2]) GUIEditor_Label[7] = guiCreateLabel(0.4899,0.6024,0.1337,0.0602,"Remove",true,GUIEditor_Tab[2]) GUIEditor_Button[4] = guiCreateButton(0.591,0.6657,0.395,0.0723,"Remove sound",true,GUIEditor_Tab[2]) guiSetVisible(GUIEditor_Window[1],false) loadStreamAndSoundList() --Add Stream addEventHandler("onClientGUIClick",GUIEditor_Button[1], function () if guiGetText(GUIEditor_Edit[1]) ~= "" then local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,streamColumn,guiGetText(GUIEditor_Edit[1]),false,false) guiSetText(GUIEditor_Edit[1],"") updateStreamAndSoundList() end end) --Add Sound addEventHandler("onClientGUIClick",GUIEditor_Button[3], function () if guiGetText(GUIEditor_Edit[2]) ~= "" then local row = guiGridListAddRow(GUIEditor_Grid[2]) guiGridListSetItemText(GUIEditor_Grid[2],row,streamColumn,guiGetText(GUIEditor_Edit[2]),false,false) guiSetText(GUIEditor_Edit[2],"") updateStreamAndSoundList() end end) --Remove stream addEventHandler("onClientGUIClick",GUIEditor_Button[2], function () if guiGridListGetSelectedItem(GUIEditor_Grid[1]) ~= -1 then local row, column = guiGridListGetSelectedItem(GUIEditor_Grid[1]) guiGridListRemoveRow(GUIEditor_Grid[1],row) updateStreamAndSoundList() end end) --Remove sound addEventHandler("onClientGUIClick",GUIEditor_Button[4], function () if guiGridListGetSelectedItem(GUIEditor_Grid[2]) ~= -1 then local row, column = guiGridListGetSelectedItem(GUIEditor_Grid[2]) guiGridListRemoveRow(GUIEditor_Grid[2],row) updateStreamAndSoundList() end end) addEventHandler("onClientGUIClick",getResourceRootElement(getThisResource()), function () if getElementType(source) == "gui-edit" then guiSetInputEnabled(true) else guiSetInputEnabled(false) end end) --Play Stream addEventHandler("onClientGUIDoubleClick",GUIEditor_Grid[1], function () if guiGridListGetSelectedItem(GUIEditor_Grid[1]) ~= -1 then local row, column = guiGridListGetSelectedItem(GUIEditor_Grid[1]) startSound(guiGridListGetItemText(GUIEditor_Grid[1],row,column)) end end) --Play Sound addEventHandler("onClientGUIDoubleClick",GUIEditor_Grid[2], function () if guiGridListGetSelectedItem(GUIEditor_Grid[2]) ~= -1 then local row, column = guiGridListGetSelectedItem(GUIEditor_Grid[2]) startSound(guiGridListGetItemText(GUIEditor_Grid[2],row,column),row) end end) addCommandHandler("radio", function () showCursor(not guiGetVisible(GUIEditor_Window[1])) guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) end) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),loadGUI)
×
×
  • Create New...