Gabriel1375

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Gabriel1375

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello, i was making a blip event system, where the staff give a /eventoblip command, then a blip will be created above him on the MAP (F11), and when anonyone kills him it returns a message, then show the killer name for everyone in the server by outputchatbox, and give the killer items... I'm currently using mta dayz gamemode, the most part of the script is working perfectly fine, my error is: The script identify if the admin killed himself or if anyone killed the admin, but it doesn't identify the killer's name / account... It doesn't give the killer items and doesn't give the killer's name... The script: --function blip has paremeter: theplayer function blip (thePlayer) --variable accountname receive the value of the getaccountname of the player, to see the player login accountname = getAccountName(getPlayerAccount(thePlayer)) --if the player who triggered the blip function is a supermoderator or an admin then if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then --output the message "special event - kill the adm identified as a $ on the map, the winner will get random items" outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF【 EVENTO ESPECIAL! 】#FFFFFF Mate o ADM identificado com o #098700cifrão ($) verde no mapa',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO vencedor ganhará itens aleátorios!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) --attach a "$" blip to the admin or supermod who started the event blip = createBlipAttachedTo (thePlayer,52,10) --set the admin data blood to 100 setElementData(thePlayer, "blood",100) --set the admin data blip event to true setElementData(thePlayer, "eventoblip",true) --set the max slots of the admin backpack to 350 setElementData(thePlayer, "MAX_Slots",350) end end --add the command /eventoblip that triggers the function blip addCommandHandler("eventoblip", blip) --table that determine what items the player will be given local itens = { {"Banana"}, {"Kiwi"}, {"Pizza"} } --function that calculates the size of the table itens above function tamanho( tabela ) local count = 0 for a in pairs( tabela ) do count = count + 1 end return count end -- function endevent has parameters: ammo, attacker, weapon, bodypart function fimdoevento(ammo, killer, weapon, bodypart) local getData = getElementData ( source, "eventoblip" ) -- quando o cara morrer , se o cara for o que tiver iniciado o evento, e o evento ainda tiver rolando if getData then -- se tiver um assassino entao if killer then local item = itens[math.random(tamanho(itens))][1] local quantidade = 1 destroyElement(blip) setElementData(source, "eventoblip",false) setElementData(killer, item , quantidade) setElementData(source, item, quantidade) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff GETDATA TRUE',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" .. getPlayerName(killer) .. "#00a5ff] matou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) else destroyElement(blip) setElementData(source, "eventoblip",false) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff O Staff #FF0000' .. getPlayerName(source) .. ' #00a5ff se matou, o evento irá reiniciar',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) end end end --add an event handler of type onplayerwasted, that triggers the fimdoevento (translating: endevent) function addEventHandler("onPlayerWasted", getRootElement(), fimdoevento) function finalizarevento(thePlayer) local pegaData = getElementData ( thePlayer, "eventoblip" ) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then if pegaData then destroyElement(blip) setElementData(thePlayer, "eventoblip",false) removeElementData(thePlayer,"eventoblip") outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#FF0000【 ATENÇÃO! 】#FFFFFF O Staff finalizou o evento.',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO ele explicará o motivo em breve!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) setElementData(thePlayer, "blood",12000) setElementData(thePlayer, "MAX_Slots",350) else outputChatBox ('#FFFFFFO Evento não está acontecendo !!!',thePlayer,255,255,255,true) end end end addCommandHandler("finalizareventoblip", finalizarevento) The meta.xml: <meta> <info author="Gabriel Bigardi" version="1.0" type="script" name="BLIP event"/> <script src="blip.lua" type="server" /> </meta> Thanks !!!
  2. Hello, Sorry for the late answers, i've been a little busy... So, i've modified my script and now it works fine to identify when i killed myself or when anyone killed me, but... It doesn't identify the "attacker" value... It doesn't give the message that the event is over because someone killed the staff, and doesn't give items to the attacker... Here is the new script: --function blip has paremeter: theplayer function blip (thePlayer) --variable accountname receive the value of the getaccountname of the player, to see the player login accountname = getAccountName(getPlayerAccount(thePlayer)) --if the player who triggered the blip function is a supermoderator or an admin then if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then --output the message "special event - kill the adm identified as a $ on the map, the winner will get random items" outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF【 EVENTO ESPECIAL! 】#FFFFFF Mate o ADM identificado com o #098700cifrão ($) verde no mapa',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO vencedor ganhará itens aleátorios!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) --attach a "$" blip to the admin or supermod who started the event blip = createBlipAttachedTo (thePlayer,52,10) --set the admin data blood to 100 setElementData(thePlayer, "blood",100) --set the admin data blip event to true setElementData(thePlayer, "eventoblip",true) --set the max slots of the admin backpack to 350 setElementData(thePlayer, "MAX_Slots",350) end end --add the command /eventoblip that triggers the function blip addCommandHandler("eventoblip", blip) --table that determine what items the player will be given local itens = { {"Banana"}, {"Kiwi"}, {"Pizza"} } --function that calculates the size of the table itens above function tamanho( tabela ) local count = 0 for a in pairs( tabela ) do count = count + 1 end return count end -- function endevent has parameters: ammo, attacker, weapon, bodypart function fimdoevento(ammo, attacker, weapon, bodypart) --varaible to stop the event data of the player who started the event local getData = getElementData ( source, "eventoblip" ) --when i die, if i'm the one who started the event, and the event is still running... if getData then -- there is a attacker if attacker then --variable item local item = itens[math.random(tamanho(itens))][1] --variable quantity local quantidade = 1 --destroy the blip attached destroyElement(blip) --remove the event data from staff setElementData(source, "eventoblip",false) --give the attacker items setElementData(attacker, item , quantidade) --give the source items (this one is working in else) setElementData(source, item, quantidade) --win message outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff ANYONE WINS THE EVENT MESSAGE',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" .. getPlayerName(attacker) .. "#00a5ff] matou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) --else if there is not a attacker so i killed myself else --destroy blip attached destroyElement(blip) --remove event data from staff setElementData(source, "eventoblip",false) --the staff killed himself, the event is over outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff O Staff #FF0000' .. getPlayerName(source) .. ' #00a5ff se matou, o evento irá reiniciar',getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) end end end --add an event handler of type onplayerwasted, that triggers the fimdoevento (translating: endevent) function addEventHandler("onPlayerWasted", getRootElement(), fimdoevento) --function to force the end of event if i give the command /finalizareventoblip (working perfectly) function finalizarevento(thePlayer) --local variable data local pegaData = getElementData ( thePlayer, "eventoblip" ) --identify account name accountname = getAccountName(getPlayerAccount(thePlayer)) -- if is a admin or supermod then if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then --if the event is running then if pegaData then --destroy blip destroyElement(blip) --remove data setElementData(thePlayer, "eventoblip",false) removeElementData(thePlayer,"eventoblip") --message admin ended the event outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#FF0000【 ATENÇÃO! 】#FFFFFF O Staff finalizou o evento.',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO ele explicará o motivo em breve!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) --blood back to normal setElementData(thePlayer, "blood",12000) --slots back to normal setElementData(thePlayer, "MAX_Slots",350) else --else if the event is not running give message event is not running outputChatBox ('#FFFFFFO Evento não está acontecendo !!!',thePlayer,255,255,255,true) end end end addCommandHandler("finalizareventoblip", finalizarevento) Also, ty again !!
  3. Hello, thanks for helping... I ve done it but now i cant even get the suicide message Idk what more can i do
  4. Hello guys, what's up ? I've made myself an blip event script, that attach a blip on the admin on the map, and the user who kills it get a random item. The most complicated part of the script is working fine, but i have a problem... The problem is: When the admin kills himself, the event doesn't end, if i die 10x, i'll have the function still running, so everytime i die it gives the message and the item... The script: (i've already commented all the lines to get easier to understand...) --function blip has paremeter: theplayer function blip (thePlayer) --variable accountname receive the value of the getaccountname of the player, to see the player login accountname = getAccountName(getPlayerAccount(thePlayer)) --if the player who triggered the blip function is a supermoderator or an admin then if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then --output the message "special event - kill the adm identified as a $ on the map, the winner will get random items" outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF【 EVENTO ESPECIAL! 】#FFFFFF Mate o ADM identificado com o #098700cifrão ($) verde no mapa',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO vencedor ganhará itens aleátorios!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) --attach a "$" blip to the admin or supermod who started the event blip = createBlipAttachedTo (thePlayer,52,10) --set the admin data blood to 100 setElementData(thePlayer, "blood",100) --set the admin data blip event to true setElementData(thePlayer, "eventoblip",true) --set the max slots of the admin backpack to 350 setElementData(thePlayer, "MAX_Slots",350) end end --add the command /eventoblip that triggers the function blip addCommandHandler("eventoblip", blip) --table that determine what items the player will be given local itens = { {"Banana"}, {"Kiwi"}, {"Pizza"} } --function that calculates the size of the table itens above function tamanho( tabela ) local count = 0 for a in pairs( tabela ) do count = count + 1 end return count end -- function endevent has parameters: ammo, attacker, weapon, bodypart function fimdoevento(ammo, attacker, weapon, bodypart) -- if there is a attacker, and the element that killed him was a player, and the killed player has the data blip event then if attacker and getElementType ( attacker ) == "player" and getElementData(source,"eventoblip") == true then --declaring a local variable item that uses the tablecount system to pickup a random item of the table items local item = itens[math.random(tamanho(itens))][1] --declaring a local variable quantity, that's equal to 1x local quantidade = 1 --destroy the blip on the map after event is over destroyElement(blip) --remove the data blip event from staff setElementData(source, "eventoblip",false) --give to the attacker and the admin(test purposes) the random item, and quantity setElementData(attacker, item , quantidade) setElementData(source, item, quantidade) --output message "congratulations attackername killed the staff and wins X quantity of the X item" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" ..getPlayerName(attacker).."#00a5ff] matou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) -- else if there is a attacker, and the attacker killed with a vehicle, and the killed player has the data blip event then elseif attacker and getElementType ( attacker ) == "vehicle" and getElementData(source,"eventoblip") == true then --destroy the blip on the map after event is over destroyElement(blip) --remove the data blip event from staff setElementData(source, "eventoblip",false) --give to the attacker and the admin(test purposes) the random item, and quantity setElementData(attacker, item , quantidade) setElementData(source, item, quantidade) --output message "congratulations attackername killed the staff and wins X quantity of the X item" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" ..getPlayerName(attacker).."#00a5ff] atropelou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) -- if none of this conditions is true then the admin accidentally killed himself from falling or other causes else --output message "the staff adminname killed himself, the event is still running" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ffO Staff ' .. getPlayerName(source) .. ' se matou, o evento continua.' ,getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) end end --add an event handler of type onplayerwasted, that triggers the fimdoevento (translating: endevent) function addEventHandler("onPlayerWasted", getRootElement(), fimdoevento) Thank you guys, and please if anyone is thinking to use the script, please have my credits in: Gabriel Bigardi
  5. But the objects it's on different distances from the ground... Don't have an exact distance to say it in the script, i have to make like an radius ?
  6. Hello, my MTA DayZ server is lagging because it has a lot of players, and a lot of flying items because these players remove these items from inventory when spawning on parachute... How can i do a resource that clean these flying or also all items ? I've seen this in a server, i think they said it's made using col shape... Ty!!!
  7. No, that's not what i'm saying, i want that THE SCRIPT connect to the database and get the information, and store it to a variable, the information RANK and EXP, because we need to reset the server and want to make and /save command, to save the stats and restore it after the database resetting, we can't do it manually, as we have more than 6000 accounts...
  8. Hello, so i have this script that gets the rank / experience from the player, and save in another database, to backup the rank/exp, because we need to reset the accounts, as it has more than 6000 accounts and its lagging because of this, and i want to know how to connect to the internal.db and get the informations, the function to get the information: rank, experience from internal.db ? The script: local dbConnection = dbConnect("sqlite", "backupexprank.db") local qh = dbQuery( dbConnection,"CREATE TABLE IF NOT EXISTS accounts (nomeconta text,patente text,experiencia text)") dbFree( qh ) function saveStat(sourcePlayer) local account = getPlayerAccount(sourcePlayer) local nomeconta = getAccountName(account) local patente = getAccountData(account, "rank") local experiencia = getPlayerIP(account, "experience") local qh = dbQuery( dbConnection, "SELECT * FROM accounts where nomeconta=?",nomeconta) local res = dbPoll(qh,-1) dbFree( qh ) if #res > 0 then dbExec( dbConnection, "UPDATE accounts SET experiencia=? where nomeconta=? ", experiencia,nomeconta ) dbExec( dbConnection, "UPDATE accounts SET patente=? where nomeconta=? ", patente,nomeconta ) outputChatBox ( "Saved account " .. nomeconta .. " with the rank " .. patente .. " with the exp at" .. experiencia ..) else dbExec(dbConnection, "INSERT INTO accounts VALUES(?, ?, ?)", nomeconta, patente, experiencia) outputChatBox ( "Saved account " .. nomeconta .. " with the rank " .. patente .. " with the exp at" .. experiencia ..) end end addCommandHandler("savestats", saveStat) Ty !!!
  9. Can you please help me ? I'm lost e.e So with this function i will save every row/data from internal.db of the player that said /savestats ? And how can i do this ? Ty !
  10. But i don't want to save all the players, because it will still be lagging, the internal.db has 50mb of data, i wan't to save just the exp/rank from players that are online and give /savestats, then we reset the database, and after this we make another script like: /getstats, to retrieve the saved stats and get back to the player account...
  11. Ah okay... But how can i get the data from internal.db and save it to another .db file ? Because the server has so much players that we have to reset, but we want to save the rank and exp from players that give the /savestats command, and the rank/exp is stored at the internal.db
  12. Now it worked fine: Why do you think that isn't working to get the player informations ? Because i think when i send it to the owner of the server i'm staff, with the elements name that he gave me (rank, experience), i dont think it's going to work, as getting info from internal.db doesn't worked yet...
  13. I don't, its just for testing, as i need to do this script for my friend server, that i'm staff, and i'm testing in my local server, and i dont have the rank system, so i tried to save other informations of the internal.db, so if this work i just change the name of the tables to give it to my friend
  14. Yeah, the players password is stored at the internal.db, i think is this happening because it isn't connecting to the internal.db to get the infos
  15. I've done that, but its giving error on "patente", that is the player password (the same error of the "experiencia")