Search the Community

Showing results for tags 'setelementdata'.



More search options

  • 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
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 9 results

  1. Добрый день. Боги скриптеры, подскажите пожалуйста, после того как я создал setElementData или local money, нужно ли их очищать/удалять при дисконекте игрока? Спасибо за ответ
  2. First of all, sorry for bad English. I am creating a script and I used the getElementData function to get data stored in the user account and then the setElementData function to get the information through the getElementData on the client but the script has the following error in debugging: Bad argument @ setElementData [Expect element at argument 1, got nil] SCRIPT: [SERVER-SIDE] function setarDados_Entrar(source) local acc = getPlayerAccount(source) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(source, "hblt", habl)--In that error line setElementData(source, "fich", ficha) -- In that error line end function setarDados_Iniciar() local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end function setarDados_Mudar(player) local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end addEventHandler("onPlayerLogin", getRootElement(), setarDados_Entrar) addEventHandler("onResourceStart", root, setarDados_Iniciar) addEventHandler("onAccountDataChange", root, setarDados_Mudar)
  3. itHyperoX

    vehicle ID

    Hello, how can i make something thins? I want set id for each vehicle which is spawned. Then i can create /getcar command. I dont want to save this forever. local vehS = 0 function createVeh(player,CMD,veh) local vehName = getVehicleIDFromName(veh) local x, y, z = getElementPosition(player) if vehName == false then --- else vehS + 1 theveh = createVehicle(vehName,x+5,y,z) setElementData(theveh,"vehID",vehS) end end addCommandHandler("cv",createVeh)
  4. Xwad

    can't store data

    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
  5. Hello guys, for some reason debugscript is saying this..Heres my script piece: setElementData(p, "acc:admin", 7) if not getElementData(p, "acc:admin") > 0 then return end Nothing else changes acc:admin. Edit: Found the solution: setElementData(p, "acc:admin", 7) if not (getElementData(p, "acc:admin") > 0) then return end But, i still don't understand, so can someone explain me whats the difference between those code blocks?
  6. So I have a quick question regarding the setElementData function. While the wiki states that it can cause quite a bit of load on the net and server CPU I assume that this is only the case for server elements... What happens if I use setElementData on something that exists only on a client? Say a gui element or any kind of element that has been created on a client. Is the data still synced with the other clients or is it kept to the client the element exists on? 3aGl3
  7. Hi there, I want to make my server as safe as I can. So it is only logic, that I heed the advice from the wiki: Script security Well, the second part (with checking the validness of client and arguments) is very easy for me to do. But for the first part, I can only assume it works, but can't test it, as I don't have a hacked client. I don't want a real hacked client, but still, I would like to test, if a rouge client would get catched and reported by my script security (I only changed the "oputputConsole" to a error report system I already have implemented). With best regards, another MTA:SA freak.
  8. Hi! This script makes possible to play a 3d sound (looped sound) by pressing the CTRL button, and stop the sound when the CTRL button is "up". Well, it has a really annoying sync bug. As you can see, there is a setElementData function in my client side script, that stores the sound element. When the player stops pressing the CTRL button then the script stops the sound with the stored element. Well the problem is that when another player press the CTRL button then the setElementData will be overwritted, and will cause really strange, annoying bugs. So the bug is: when player1 press CTRL, and after that player2 also press CTRL then the sound for player1 will not stop anymore, because player2 owerwrited the setElementData, when he pressed CTRL. Well, its not easy to explain, so i hope you understood me. Is the any way to avoid this owerwriting? or do i have to do this another way, without setElementData? Thanks in advance. client --start sound function start_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "start_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "down", start_fire_sound) function start_fire_c(veh) local x,y,z = getElementPosition (veh) local sound_fire = playSound3D("files/fire.wav",x,y,z, true) setSoundMaxDistance( sound_fire, 500 ) setSoundVolume(sound_fire, 1) attachElements ( sound_fire, veh, 0,0,0 ) setElementData(localPlayer, "sound_fire", sound_fire) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", localPlayer, start_fire_c ) --stop sound function stop_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "stop_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "up", stop_fire_sound) function stop_fire_sound_c(veh) local x,y,z = getElementPosition (veh) local sound_fire_lastshot = playSound3D("files/fire_lastshot.wav",x,y,z, false) setSoundMaxDistance( sound_fire_lastshot, 500 ) setSoundVolume(sound_fire_lastshot, 1) attachElements ( sound_fire_lastshot, veh, 0,0,0 ) local sound_fire = getElementData(localPlayer, "sound_fire") stopSound(sound_fire) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", localPlayer, stop_fire_sound_c ) server function start_fire_sound(veh) triggerClientEvent ("start_fire_sound", getRootElement(), veh) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", getRootElement(), start_fire_sound ) function stop_fire_sound(veh) triggerClientEvent ("stop_fire_sound", getRootElement(), veh) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", getRootElement(), stop_fire_sound )
  9. السلام عليكم ورحمة الله وبركاته انا بفضل الله ثم بفضلكم عرفت اشياء كثيرة عن البرمجة لكني ما سألت قبل عن الداتا setElementData وانا نوب مرة فيها انا ابي اسوي داتا من ملف مثلاً يكون اسمه theData وابي اجيب الداتا في ملف آخر مثلاً getData لكن بشروط اذا الداتا حقت الملف الاول = الداتا حقت الملف الثاني يخرج كلمة في الشات : تم تثبيت الاضافة واذا الملف الاول لا يساوي الملف الثاني في الداتا تخرج رسالة اخرى تقول : لم يتم تثبيت الاضافة هذا اللي ابيه - اتمنى مساعدة