-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You can't get it by any scripting function, only by opening the "internal.db" file.
-
function build_Dialog() gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 633, 608 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "SEALS Clan [ADMIN PANEL]", false) guiWindowSetSizable(gui["_root"], false) guiSetVisible ( gui["_root"], false ) gui["label"] = guiCreateLabel(10, 25, 201, 41, "Players Online:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(400, 25, 201, 41, "Variaveis:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["setr"] = guiCreateEdit(250, 95, 121, 21, "", false, gui["_root"]) guiEditSetMaxLength(gui["setr"], 32767) gui["label_3"] = guiCreateLabel(250, 75, 71, 16, "Setar para:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["srt_botao"] = guiCreateButton(270, 125, 75, 23, "Setar", false, gui["_root"]) if on_srt_botao_clicked then addEventHandler("onClientGUIClick", gui["srt_botao"], on_srt_botao_clicked, false) end gui["fecha_botao"] = guiCreateButton(270, 575, 75, 23, "Fechar", false, gui["_root"]) if on_fecha_botao_clicked then addEventHandler("onClientGUIClick", gui["fecha_botao"], on_fecha_botao_clicked, false) end gui["listWidget"] = guiCreateGridList(10, 65, 211, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget"], false) gui["listWidget_col"] = guiGridListAddColumn(gui["listWidget"], "", 0.85) gui["listWidget_2"] = guiCreateGridList(400, 65, 221, 531, false, gui["_root"]) guiGridListSetSortingEnabled(gui["listWidget_2"], false) gui["listWidget_2_col"] = guiGridListAddColumn(gui["listWidget_2"], "", 0.85) return gui, windowWidth, windowHeight end addEventHandler ( "onClientResourceStart", resourceRoot, build_Dialog ) function on_srt_botao_clicked ( button, state, absoluteX, absoluteY ) if ( button ~= "left" ) or ( state ~= "up" ) then end end function on_fecha_botao_clicked ( button, state, absoluteX, absoluteY ) if ( button ~= "left" ) or ( state ~= "up" ) then guiSetVisible ( gui["_root"], false ) end end bindKey ( "F3", function ( ) guiSetVisible ( gui["_root"], not guiGetVisible ( gui["_root"] ) ) showCursor ( guiGetVisible ( gui["_root"] ) ) if ( guiGetVisible ( gui["_root"] ) ) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( gui["listWidget"] ) guiGridListSetItemText ( gui["listWidget"], row, gui["listWidget_col"], getPlayerName ( playeritem ), false, false ) end end end )
-
You're welcome.
-
You're welcome. I do, but I don't give it to everyone, you can send me a PM explaining why you want it.
-
No, the only way would be requesting the data from client and get it at server, then send it to the client.
-
Oh, yeah, I forgot to remove it, remove this line: outputChatBox ( ContextBar.entries[#ContextBar.entries].text )
-
Use the example from: https://wiki.multitheftauto.com/wiki/GuiCreateGridList Also, "getAllElementData" is a server side only function, you can't use it on a client side script.
-
function build_Dialog() gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 633, 608 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "SEALS Clan [ADMIN PANEL]", false) guiWindowSetSizable(gui["_root"], false) guiSetVisible(gui["_root"], false) gui._placeHolders["online"] = {left = 10, top = 65, width = 211, height = 531, parent = gui["_root"]} gui._placeHolders["variaveis"] = {left = 400, top = 65, width = 221, height = 531, parent = gui["_root"]} gui["label"] = guiCreateLabel(10, 25, 201, 41, "Players Online:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "left", false) guiLabelSetVerticalAlign(gui["label"], "center") gui["label_2"] = guiCreateLabel(400, 25, 201, 41, "Variaveis:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_2"], "left", false) guiLabelSetVerticalAlign(gui["label_2"], "center") gui["setr"] = guiCreateEdit(250, 95, 121, 21, "", false, gui["_root"]) guiEditSetMaxLength(gui["setr"], 32767) gui["label_3"] = guiCreateLabel(250, 75, 71, 16, "Setar para:", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label_3"], "left", false) guiLabelSetVerticalAlign(gui["label_3"], "center") gui["srt_botao"] = guiCreateButton(270, 125, 75, 23, "Setar", false, gui["_root"]) if on_srt_botao_clicked then addEventHandler("onClientGUIClick", gui["srt_botao"], on_srt_botao_clicked, false) end gui["fecha_botao"] = guiCreateButton(270, 575, 75, 23, "Fechar", false, gui["_root"]) if on_fecha_botao_clicked then addEventHandler("onClientGUIClick", gui["fecha_botao"], on_fecha_botao_clicked, false) end return gui, windowWidth, windowHeight end addEventHandler ( "onClientResourceStart", resourceRoot, build_Dialog ) bindKey ( "F2", function ( ) guiSetVisible ( gui["_root"], not guiGetVisible ( gui["_root"] ) ) showCursor ( guiGetVisible ( gui["_root"] ) ) end ) Now you must create a resource and a .lua file, then you put this code on it and create a meta.xml for it. https://wiki.multitheftauto.com/wiki/Meta.xml NOTE: THIS IS A CLIENT SIDE SCRIPT.
-
Of what script are you talking about?
-
https://wiki.multitheftauto.com/wiki/GuiCreateGridList The example does what you want.
-
All account functions are server side only.
-
You are using it client side?
-
And that element data doesn't appear on getAllElementData?
-
And it sets your sniper ammo?
-
Ok, I asked to Remp and he says that he gave permission, so I've fixed the code ( you had missing stuff, plus "test" command is built-in MTA, so I renamed it to "test2" ). gColours = { primary = {255, 69, 59, 255}, secondary = {255, 118, 46, 255}, tertiary = {232, 42, 104, 255}, defaultLabel = {255, 255, 255}, grey = {120, 120, 120}, } ContextBar = { height = 28, speed = 20, step = 2, life = 8000, update = 0, textColour = {unpack(gColours.primary)}, lineColour = {0, 0, 0}, entries = {} } local sx, sy = guiGetScreenSize ( ) gEnabled = true function ContextBar.add(text) if not gEnabled then return end local y = sy - ContextBar.height if #ContextBar.entries > 0 then if ContextBar.entries[#ContextBar.entries].text == text then return end y = ContextBar.entries[#ContextBar.entries].y - ContextBar.height end local pixelsPerSecond = (1000 / ContextBar.speed) * ContextBar.step local alphaStep = (sy - y - ContextBar.height) / pixelsPerSecond ContextBar.entries[#ContextBar.entries + 1] = { text = text, creation = getTickCount(), y = y, landed = false, alphaStep = alphaStep == 0 and 0.05 or (1 / ((alphaStep * 1000) / ContextBar.speed)), alpha = alphaStep == 0 and 1 or 0, } end addEventHandler("onClientRender", root, function() for _,bar in ipairs(ContextBar.entries) do dxDrawRectangle(0, bar.y, sx, ContextBar.height, tocolor(0, 0, 0, math.lerp(0, 170, bar.alpha)), true) dxDrawText(bar.text, 0, bar.y, sx, bar.y + ContextBar.height, tocolor(ContextBar.textColour[1], ContextBar.textColour[2], ContextBar.textColour[3], math.lerp(0, 255, bar.alpha)), 1, "default-bold", "center", "center", true, true, true) dxDrawLine(0, bar.y, sx, bar.y, tocolor(ContextBar.lineColour[1], ContextBar.lineColour[2], ContextBar.lineColour[3], math.lerp(0, 255, bar.alpha)), 1, true) end local tick = getTickCount() if tick > (ContextBar.update + ContextBar.speed) then ContextBar.update = tick if #ContextBar.entries > 1 then for i = #ContextBar.entries, 1, -1 do if ContextBar.entries[i].y > sy then table.remove(ContextBar.entries, i) else ContextBar.entries[i].alpha = math.min(1, ContextBar.entries[i].alpha + ContextBar.entries[i].alphaStep) ContextBar.entries[i].y = ContextBar.entries[i].y + ContextBar.step if i ~= 1 and #ContextBar.entries == 2 and ContextBar.entries[i].y > (sy - ContextBar.height) then ContextBar.entries[i].y = sy - ContextBar.height end end end elseif #ContextBar.entries == 1 then if not ContextBar.entries[1].landed then ContextBar.entries[1].landed = true ContextBar.entries[1].creation = tick end if tick > (ContextBar.entries[1].creation + ContextBar.life) then ContextBar.entries[1].alpha = ContextBar.entries[1].alpha - ContextBar.entries[1].alphaStep if ContextBar.entries[1].alpha <= 0 then ContextBar.entries[1] = nil end end end end end ) function math.lerp(from, to, t) return from + (to - from) * t end function add() ContextBar.add("Basic Testing.") end addCommandHandler("test2",add)
-
Well, maybe these aren't set as element data?
-
Did you set it as server side on meta.xml?
-
That's good to hear, and I'm glad that you did the right thing removing it.
-
I didn't come in rage at all, I was actually checking out the server, using a different nick to avoid getting banned ( minutes ago you was pissing me off at my server, that's why ), then when I seen the information bar, I noticed it was the same as SAES, and I told to xXMADEXx that it was stolen, he started to deny it, then jailed me, and started to insult me, it kept like that for some minutes until I got banned. P.S: I don't want to argue with you, I was just saying the truth about what happened when I told you that it was stolen.
-
local pArea = createRadarArea( 2130, 630, 200, 100, 255, 255, 255, 125 ) local pArea2 = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 255, 255, 255, 125 ) local pCuboid = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 30 ) local pCuboid2 = createColCuboid( 2486.5935058594, 678.20172119141, 9.5689830780029, 245, 133, 30 ) local pArea3 = createRadarArea( 1858, 623, 140, 165, 255, 255, 255, 125 ) local pCuboid3 = createColCuboid( 1856.2864990234, 627.07629394531, 9, 138.25, 152.75, 30 ) local pArea4 = createRadarArea( 1577, 663, 180, 130, 255, 255, 255, 125 ) local pCuboid4 = createColCuboid( 1576.8956298828, 662.84362792969, 9.671875, 181, 120.5, 30 ) local pArea5 = createRadarArea( 2778, 834, 110, 190, 255, 255, 255, 125 ) local pCuboid5 = createColCuboid( 2777.4248046875, 833.88018798828, 9.6484375, 113.5, 188, 30 ) addEventHandler("onResourceStart", resourceRoot, function() outputDebugString("|~| Turf system by manve1 |~| Has been turned on! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) end ) --[[addEventHandler("onResourceStop", resourceRoot, function() outputDebugString("|~| Turf system by manve1 |~| Has been turned off! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) saveS = xmlLoadFile( 'file_saves.xml' ) local save_info = xmlFindChild(saveS, 'turf', 0) xmlNodeSetAttribute( save_info, 'saved', 'nothing new' ) end )]] addEventHandler( 'onColShapeHit', pCuboid, function( player ) if (getPlayerGang( player )) then local pGang = exports [ "gang_system" ]:getPlayerGang ( player ) local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) local rR, gG, bB = getRadarAreaColor( pArea ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(player, 'friendly', player) else setRadarAreaFlashing( pArea, true ) triggerClientEvent(player, 'time', player) triggerClientEvent(player, 'countdown', player) pArea1Timer = setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( player, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", player, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 6000, 1 ) end else triggerClientEvent(player, 'group', player) end end ) addEventHandler( 'onColShapeLeave', root, function( player ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) triggerClientEvent(player, 'time2', player) triggerClientEvent(player, 'friendly2', player) if isTimer( pArea1Timer ) then killTimer( pArea1Timer ) end end end ) ----------------------------- addEventHandler( 'onColShapeHit', root, function( p ) if (getPlayerGang( p )) then if( source == pCuboid2 ) then local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) local rR, gG, bB = getRadarAreaColor( pArea2 ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(p, 'friendly', p) else setRadarAreaFlashing( pArea2, true ) triggerClientEvent(p, 'time', p) pArea2Timer = setTimer( function() setRadarAreaColor (pArea2, iR2, iG2, iB2, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea2, false ) end, 600000, 1 ) end end else triggerClientEvent(p, 'group', p) end end ) addEventHandler( 'onColShapeLeave', root, function( p ) if( source == pCuboid2 ) then setRadarAreaFlashing( pArea2, false ) triggerClientEvent(p, 'time2', p) triggerClientEvent(p, 'friendly2', p) if isTimer( pArea2Timer ) then killTimer( pArea2Timer ) end end end ) ------------------------------------ addEventHandler( 'onColShapeHit', root, function( p ) if (getPlayerGang( p )) then if( source == pCuboid3 ) then local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) local rR, gG, bB = getRadarAreaColor( pArea3 ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(p, 'friendly', p) else setRadarAreaFlashing( pArea3, true ) triggerClientEvent(p, 'time', p) pArea3Timer = setTimer( function() setRadarAreaColor (pArea3, iR2, iG2, iB2, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea3, false ) end, 600000, 1 ) end end else triggerClientEvent(p, 'group', p) end end ) addEventHandler( 'onColShapeLeave', root, function( p ) if( source == pCuboid3 ) then setRadarAreaFlashing( pArea3, false ) triggerClientEvent(p, 'time2', p) triggerClientEvent(p, 'friendly2', p) if isTimer( pArea3Timer ) then killTimer( pArea3Timer ) end end end ) ------------------------------------- addEventHandler( 'onColShapeHit', root, function( p ) if (getPlayerGang( p )) then if( source == pCuboid4 ) then local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) local rR, gG, bB = getRadarAreaColor( pArea4 ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(p, 'friendly', p) else setRadarAreaFlashing( pArea4, true ) triggerClientEvent(p, 'time', p) pArea4Timer = setTimer( function() setRadarAreaColor (pArea4, iR2, iG2, iB2, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea4, false ) end, 600000, 1 ) end end else triggerClientEvent(p, 'group', p) end end ) addEventHandler( 'onColShapeLeave', root, function( p ) if( source == pCuboid4 ) then setRadarAreaFlashing( pArea4, false ) triggerClientEvent(p, 'time2', p) triggerClientEvent(p, 'friendly2', p) if isTimer( pArea3Timer ) then killTimer( pArea3Timer ) end end end ) ----------------------------------- addEventHandler( 'onColShapeHit', root, function( p ) if (getPlayerGang( p )) then if( source == pCuboid5 ) then local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) local rR, gG, bB = getRadarAreaColor( pArea5 ) if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then triggerClientEvent(p, 'friendly', p) else setRadarAreaFlashing( pArea5, true ) triggerClientEvent(p, 'time', p) pArea5Timer = setTimer( function() setRadarAreaColor (pArea5, iR2, iG2, iB2, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea5, false ) end, 600000, 1 ) end end else triggerClientEvent(p, 'group', p) end end ) addEventHandler( 'onColShapeLeave', root, function( p ) if( source == pCuboid5 ) then setRadarAreaFlashing( pArea5, false ) triggerClientEvent(p, 'time2', p) triggerClientEvent(p, 'friendly2', p) if isTimer( pArea5Timer ) then killTimer( pArea5Timer ) end end end )
-
createBlip (x,y,z, type) setBlipVisibleDistance(blip, 500) You didn't define "blip". Also, it's "outputChatBox", not "outPutChatBox".
-
exports [ "gang_system" ]:getPlayerGang ( player ) That function returns the gang of a player, you must use it inside the function, instead of team.