Jump to content

Search the Community

Showing results for tags 'setelementdata'.

  • 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 15 results

  1. eu fiz um sistema de /pro, so que quando o player morre ele continua com o pro, eu ja tentei desativar com o evento "onPlayerWasted" mas nao funciona. function godCommand(player) local conta = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then if getElementData(player,"onProt") then setElementData(player,"onProt",false) setElementModel(player, 0) outputChatBox("O staff "..getPlayerName(player).." esta OFF",root,255,255,0,true) else setElementData(player,"onProt",true) setElementModel(player, 10) outputChatBox("O staff "..getPlayerName(player).." esta ON",root,255,255,0,true) end end end addCommandHandler("pro",godCommand) eu queria colocar o onProt no false quando o player morrer.
  2. Estou fazendo um sistema de Porte de Armas + Venda de Armas. E eu quero deixar assim, só quem pode comprar arma é quem tem o porte de armas. Quem não tem, não consegue comprar as armas. Alguém que possa me ajudar?
  3. function upLevel (thePlayer) for i,player in ipairs(getElementsByType("player")) do if ( player ) then if ( getPlayerAccount(player) ) and not ( isGuestAccount(getPlayerAccount(player)) ) then setElementData(player,"minutes",(getElementData(player,"minutes") or 0) +1) if ( getElementData(player,"minutes") > 60 ) then setElementData(player,"minutes",0) setElementData(player,"Level",(getElementData(player,"Level") or 0) +1) local bonus = math.random(650,1200) local interest = math.random(60,220) local value = (bonus-interest) givePlayerMoney(player,value) outputChatBox("#FFFFFF[ #FAAC58Level #FFFFFF]", player, 255, 255, 255, true ) outputChatBox("#FFFFFFPagamento : R$ #00FF00"..value, player, 255, 255, 255, true ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then end end end end end end setTimer(upLevel,69000,0) function setLevelLogin () local account = getPlayerAccount(source) if ( account ) then local Level = (getAccountData(account,"Level") or 0) local minutes = (getAccountData(account,"minutes") or 0) setElementData(source,"Level",Level) setElementData(source,"minutes",minutes) end end addEventHandler("onPlayerLogin",getRootElement(),setLevelLogin) function setLevelJoin () setElementData(source,"Level",0) setElementData(source,"minutes",0) end addEventHandler("onPlayerJoin",getRootElement(),setLevelJoin) function setLevelQuit () local account = getPlayerAccount(source) if ( account ) then local minutes = (getElementData(source,"minutes") or 0) local Level = (getElementData(source,"Level") or 0) setAccountData(account,"minutes",minutes) setAccountData(account,"Level",Level) end end addEventHandler("onPlayerQuit",getRootElement(),setLevelQuit) este é o script
  4. Estou fazendo um inventário no estilo desses Húngaros, porém como não tenho conhecimento nenhum sobre sql e pouco sobre tabelas, resolvi usar o bom e velho elementData. Porém ficou a dúvida se iria ter problemas em relação ao desempenho/processamento desses dados, pois teria slots para 20 itens diferentes nesse inventário e todos com os dados armazenados através de elementData. Eu teria problemas com isso? Se sim, a única saída seria usando tabelas?
  5. Estou com um problema, é o seguinte: Estou usando o setElementData, ele funciona perfeitamente para estocar o valor determinado. Porém quando o "source", o player sai do server como por exemplo dá "reconnect" esse valor estocado não fica salvo. Alguém tem ideia de como consigo fazer para salvar ? Desde já agradeço!
  6. Добрый день. Боги скриптеры, подскажите пожалуйста, после того как я создал setElementData или local money, нужно ли их очищать/удалять при дисконекте игрока? Спасибо за ответ
  7. 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)
  8. 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)
  9. 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
  10. 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?
  11. 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
  12. 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.
  13. 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 )
  14. السلام عليكم ورحمة الله وبركاته انا بفضل الله ثم بفضلكم عرفت اشياء كثيرة عن البرمجة لكني ما سألت قبل عن الداتا setElementData وانا نوب مرة فيها انا ابي اسوي داتا من ملف مثلاً يكون اسمه theData وابي اجيب الداتا في ملف آخر مثلاً getData لكن بشروط اذا الداتا حقت الملف الاول = الداتا حقت الملف الثاني يخرج كلمة في الشات : تم تثبيت الاضافة واذا الملف الاول لا يساوي الملف الثاني في الداتا تخرج رسالة اخرى تقول : لم يتم تثبيت الاضافة هذا اللي ابيه - اتمنى مساعدة
×
×
  • Create New...