Jump to content

Search the Community

Showing results for tags 'data'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 17 results

  1. Let's talk script security. It might be a taboo topic for some but it shouldn't, at all. In fact, the more people talk about this and unite to discuss and create robust, safe and well-coded scripts, the better the MTA resource development community will be. Rules: Main article: https://wiki.multitheftauto.com/wiki/Script_security The key points are there, but the code examples don't suffice, and the implementations will vary depending on the gamemode and resources. Pinned information: Coming soon Notes: - I'm not perfect and everyone makes mistakes. Please correct me when I'm wrong. - Eventually if this becomes a popular topic, I am willing to incorporate translations of certain explanations into other languages in this OP, as I know a majority of the MTA community doesn't master the English language and prefers to communicate and read in other languages.
  2. سلام میخواستم بدونم چطور باید دیتا های پلیر مثل فکشنش اسکینش میزان پولش و غیره رو وقتی از سرور میره ذخیره کنم و وقتی دوباره بر میگرده همون اطلاعاتو بهش بدم؟
  3. I would like to know how I could get ElementData from server to client and vice versa -- server side marker = createMarker(0, 0, 1.5, "cylinder", 2, 255, 0, 0) setElementData(marker, "Item", 5) addEvent("GetItem", true) addEventHandler("GetItem", root, function() ClientMarker = marker ItemOfClientMarker = getElementData(marker, "Item") end) addEventHandler("onMarkerHit", marker, function(hp) triggerClientEvent("Element", resourceRoot) setElementData(hp, "ItemTwo", ElementVariable+getElementData(marker, "Item")) end) -- client side function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,...) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getCameraMatrix() local distance = distance or 20 local height = height or 1 if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center") end end end end setElementData(getLocalPlayer(), "ItemTwo", 0) addEvent("Element", true) addEventHandler("Element", root, function() ElementVariable = getElementData(getLocalPlayer() , "ItemTwo") end) addEventHandler("onClientRender", root, function() triggerServerEvent("GetItem", root) dxDrawTextOnElement(ClientMarker, tostring(ItemOfClientMarker), 2, 50, 255, 255, 0, 3, "arial") end) Does it have a chance to work? because that's something I imagine...
  4. -- server side cylinder = createMarker(-712.09100, 967.01917, 12.33547-1, "cylinder", 1.5, 255, 50, 0, 255) setElementData(cylinder, "BoxWithPoints", 0) function TIMER() if getElementData(cylinder, "BoxWithPoints") >= 8 then setElementData(cylinder, "BoxWithPoints", 8) else setElementData(cylinder, "BoxWithPoints", getElementData(cylinder, "BoxWithPoints")+1) end if isElementWithinMarker(source, cylinder) then triggerServerEvent("givePointsToServer", root) PointsServer = getElementData(source, "points") BoxPoints = getElementData(cylinder, "BoxWithPoints") setElementData(source, "points", PointsServer + BoxPoints) setElementData(cylinder, "BoxWithPoints", 0) end end setTimer(TIMER, 3000, 0) -- client side setElementData(getLocalPlayer(), "points", 0) addCommandHandler("ShowMyPoints", function() outputChatBox(tostring(getElementData(getLocalPlayer(), "points")), 255, 255, 0) end) addEvent("givePointsToServer", true) addEventHandler("givePointsToServer", root, function(player) local player = client setElementData(player, "points", getElementData(player, "points")) end) The problem is with the ruler where isElementWithinMarker (source, cylinder) shows me the error that argument 1 got nil, I don't know what to think about it because I checked meta.xml and server side and client side is the correct type, could someone explain why is this happening?
  5. I would like to know something about ElementData, the most about these two commands {getElementData, setElementData}, could someone help me understand these two things. For example, write a guide that would help me a lot and give me a heart
  6. I would like to ask where I can find a guide on: createElement, ElementData, Shaders etc. I need it because soon I will be making radar and inventory system. It would be nice if you would share your knowledge on the things I gave
  7. Fala pessoal,baixei um mod de RG onde tem a opção de se colocar o nome completo,eu queria q esse nome fosse para o nink do jogador quando escrevesse no chat.Tenho uma pequena noção sobre database
  8. if i create a table, and i insert datas with table.insert, the datas are deleted when i reconnect.. why? how to save datas? sorry for my terrible english :ss
  9. 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
  10. Hi Guys Give me a resource for saving money, skin when player death and when player leave the server Give me a account data saver Thanks ❤
  11. -- This piece of code in located in the 'onPlayerQuit' event handler. It saves the player's weapons and ammo if he has any, this is all working correctly local weapons = {} for slot = 1, 12 do local weapon = getPedWeapon(source, slot) if weapon > 0 then local ammo = getPedTotalAmmo(source, slot) if ammo > 0 then table.insert(weapons, {weapon, ammo}) end end end -- This is what appears under the 'weapons' column in the player's account table entry [ [ [ 30, 176 ] ] ] -- Which means the player left the server and had an AK-47 with total 176 ammo left -- And this is the part which loads the SQL weapons data for weapon, ammo in ipairs(fromJSON(accountData.weapons)) do giveWeapon(player, tonumber(weapon), tonumber(ammo)) end -- The problem is, the player doesn't get the weapons he has saved, instead, he'll be given a brassknuckle everytime and the SQL entry is reset Any ideas why it is not working properly? I'm using SQLite not MySQL. The weapons are saved correctly, so it would seem that the problems stems in the loading part.
  12. local level = 0 function render (player, level) level = getElementData player, "LEVEL") or 0 dxDrawText("level ".. level, 110 - 1, 717 - 1, 381 - 1, 754 - 1, tocolor(0, 0, 0, 255), 1.30, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("level ".. level, 110 + 1, 717 - 1, 381 + 1, 754 - 1, tocolor(0, 0, 0, 255), 1.30, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("level ".. level, 110 - 1, 717 + 1, 381 - 1, 754 + 1, tocolor(0, 0, 0, 255), 1.30, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("level ".. level, 110 + 1, 717 + 1, 381 + 1, 754 + 1, tocolor(0, 0, 0, 255), 1.30, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("level ".. level, 110, 717, 381, 754, tocolor(255, 255, 255, 255), 1.30, "bankgothic", "left", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, render) can someone pls tell me whats wrong with this script pls and yes i am a bit new to scripting in lua
  13. 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
  14. السلام عليكم ورحمة الله وبركانخ كيف الحالكم؟ انا عايز مصمم برامج يساعدني الصورة (1) الادمن يقدر يضيف او يحذف الصورة (2) بتطلع معاينة بحيث يظهرلك كود بيرسل لبرنامج المحاسب5.exe ===== ويكون ينفع لــ XP و window 7 اللي يعرف ياريت يقولي (مشارك) حتى لو تشوف اسبوع مثلا واي صعوبات تواجهك قولي .... وشكرا
  15. 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?
  16. My problem is that it's not storing the data in the local mg = {}. The debugscript says: bad argumentum @ 'setElememtData' expected element at argument 1, got table Thanks in advance! function mg_pos() createMG(-2861.9, 19.4, 15.83, 0, 0, 188) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), mg_pos) --MG 1 local mg = {} function createMG(posX,posY,posZ,rotX,rotY,rotZ) local weapon_base = createObject ( 1897, posX,posY,posZ,rotX,rotY,rotZ) local weapon = createObject ( 356, 0,0,0) attachElements ( weapon, weapon_base, -0.55, 0, 0.75, 0, 0, 0) setElementData ( mg, "weapon_base", weapon_base) setElementData ( mg, "weapon", weapon) end
  17. DarkxD

    SaveAccount

    Hallo, please help me!
×
×
  • Create New...