# Search the Community

Showing results for tags 'get'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• Multi Theft Auto: San Andreas 1.x
• Support for MTA:SA 1.x
• User Guides
• Open Source Contributors
• Suggestions
• Ban appeals
• General MTA
• News
• Media
• Site/Forum/Discord/Mantis/Wiki related
• MTA Chat
• Other languages
• MTA Community
• Scripting
• Maps
• Resources
• Other Creations & GTA modding
• Competitive gameplay
• Servers
• Other
• Archive
• Private Bugtracker

• 0 Replies

• 0 Views

Found 15 results

1. ## [HELP] How to get the moving dx element position?

This is the code: local now = getTickCount() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 2500) - start), "Linear") local now2 = getTickCount() local x2,y2 = interpolateBetween(asd, asd1, 0, fgh, fgh1, 0, (now2 - start2) / ((start2 +2500) - start2), "Linear") if right == false then dxDrawRectangle(x, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255)) else dxDrawRectangle(x2, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255)) end -- if x >= 1063 and x <= 1073 and right == false then test = true elseif x >= 1089 and x <= 1099 and right == false then test = true elseif x >= 1158 and x <= 1172 and right == false then test = true elseif x >= 1212 and x <= 1232 and right == false then test = true elseif x >= 1276 and x <= 1293 and right == false then test = true elseif x >= 1423 and x <= 1433 and right == false then test = true elseif x >= 1476 and x <= 1487 and right == false then test = true else test = false end i want change the test to true when the rectangle is in the granted position, but how can i get the momentary position of the dx rectangle?
2. ## [HELP] How to get online player count from another server?

I want get online player count from my secondary server, and show with a label.. But how is it possible?
3. ## [HELP] How to get this data from yt video?

I wanna get remaining time from the video, but does not working.. Why? function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then local minutes, seconds = convertTime(tonumber(data.length)) if seconds < 10 then seconds = "0"..seconds end outputChatBox("Title: "..data.title) outputChatBox("Length: "..minutes..":"..seconds ) outputChatBox("Remaining: "..data.remaining) loadBrowserURL( browser, data.link ) end end
4. ## [HELP] Get element from a Table?

is it possible to get an element from a table by type , for example when i get attached elements to my car , i attached a sound element to my car. but get attached elements returns all the attached elements in to a table ( as i know) , is there a way to get the sound element from the table ???
5. ## [HELP] How to create a bank system?

I want create a bank-system. But i don't know, how to begin the script. Can i make it possible this with setElementData, and getElementDatas? sorry for my bad english
6. ## [HELP] How to make this script?

I want create a script, which tp a player to me, and teleport me to a player, like in admin panel, just with command. How to make this? For example: /tpto playername , and /tpme playername. And when i teleport a player to me, the player get out from vehicle
7. ## [HELP] How to get mute remaining time?

How to get mute remaining time? For example i write /getmute, and then output "Mute remaining time: 5 mins", or "You are not muted". Sorry for my bad english.
8. ## Passing meta settings XML to client

Hello, I'm trying to pass my server side settings defined in my meta.xml to the client. However, when passing the table of XML data to the client, the data does not persist. Here's my server side code: addEvent("onClientRequestResourceSettings", true) addEventHandler("onClientRequestResourceSettings", resourceRoot, function() local xml = xmlLoadFile("meta.xml") local settingsNode = xmlFindChild(xml, "settings", 0) if(settingsNode) then local settings = xmlNodeGetChildren(settingsNode) triggerClientEvent(client, "onServerProvideResourceSettings", resourceRoot, settings) end xmlUnloadFile(xml) end ) That above event is called client side when the resource starts. Here's the client side code: addEvent("onServerProvideResourceSettings", true) addEventHandler("onServerProvideResourceSettings", resourceRoot, function(theSettings) iprint("Settings provided: "..inspect(theSettings)) --Output: "Settings provided: { }" end ) However my settings table is not being passed to the client. When printing the output, it appears to be an empty table. I'm aware there is a limitation of passing xml data to the client, however as this is in fact a table data type, I wouldn't of thought there would be an issue? Can anyone point me in the right direction, or perhaps provide some better solutions for passing settings data from the meta.xml to the client? Cheers.
9. ## setPlayerPosition

I was creating a new game mode after I do all GUI I did this script but when I click on "ENTER1" key it didn't respond.
10. ## [HELP] How to get my account name in client side?

I tried triggering, but does not working :c How to get my account name in client side?
11. ## [HELP] Why not working get, and setAccountData?

This is the code: function onPlayerQuit ( thePlayer) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local nametagszin = getPlayerNametagColor ( thePlayer ) setAccountData ( playeraccount, "ntszin", nametagszin ) end end end function onPlayerLogin (_, playeraccount ) local playeraccount = getPlayerAccount ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if ( playeraccount ) then local nametagszin = getAccountData ( playeraccount, "ntszin" ) if ( nametagszin ) then setPlayerNametagColor ( thePlayer, r, g, b ) end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) No error(s)/warning(s) in debugscript 3.. What wrong?
12. ## GET account ID

Boton8 = guiCreateLabel(137, 142, 111, 25, "LEGAJO2", false, Ventana);guiSetProperty(Boton8, "NormalTextColour", "FF27F512") addCommandHandler("p", function() local team = getPlayerTeam(localPlayer) if team then local teamName = getTeamName(team) if teamName == "MOBSA" then local getGui = guiGetVisible(Ventana) if not getGui then guiSetVisible(Ventana, true) guiSetText(Boton10, getPlayerMoney(localplayer)) guiSetText(Boton2, teamName) guiSetText(Boton4, getPlayerName(localPlayer)) guiSetText(Boton8, ID ) --<<Aca necesitaria poner la id del jugador, digamos que aparesca su id showCursor(true) else guiSetVisible(Ventana, false) showCursor(false) print ("Tu trabajas de chofer actualmente") end else print ("Tu trabajas de chofer actualmente") end end end ) Buenas, mi duda es como sacar la id de los jugadores? Veo cual son porque quedan guardadas pero como hago para volcar esos datos en estos textos? Gracias!
13. ## [QUESTION] How can I get players played time?

i have this script: exports.scoreboard:addScoreboardColumn('Játszott idő') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Játszott idő", tostring( hours )..' óra '..tostring( min )..' perc' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Játszott idő' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Játszott idő-hours", tostring(hours) ) setAccountData ( playeraccount, "Játszott idő-min", tostring(min) ) setAccountData ( playeraccount, "Játszott idő-sec", tostring(sec) ) setAccountData ( playeraccount, "Játszott idő", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Játszott idő" ) local hou = getAccountData ( playeraccount, "Játszott idő-hours") local min = getAccountData ( playeraccount, "Játszott idő-min") local sec = getAccountData ( playeraccount, "Játszott idő-sec") if ( time ) then setElementData ( source, "Játszott idő", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Játszott idő",0 ) setAccountData ( playeraccount, "Játszott idő",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) and i want add a function, what get players played time, and when reach xy played time (for example 30), then do something (for example output a text to chat box) How is it possible?
14. ## Why move the dx elements, when guiGetScreenSize is added?

In 1440x900 resolution, the dx elements they are in the right place, but in 1920x1080 the dx elements move up, and in 1366x768 the dx elements move down.. Why? how to fix this? the guigetscreensize is added with the correct coordinates..
15. ## Get vehicle from a label

Hi! I have a faction panel, and I want to do that I have a list of faction vehicles with label, and when I click one of these, give me informations of the clicked vehicle. With the members(players) I can do it, because there is a getPlayerFromName. But with vehicles how can I do this?