Search the Community

Showing results for tags 'error'.



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
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 33 results

  1. When I connect to a server, The downloading doesn't start. it's stuck on 0% and after 10 seconds it disconnects automatically and an error appears in the menu, 'Error downloading requested files. Timeout was reached. [Operation too slow. Less than 10 bytes/sec transferred the last 10 seconds] [performancebrowser_client.lua]' I've tried everything, Re-installing MTA, Deleting the resources, Changing the firewall settings. Non of them works. Please help .-.
  2. Anyone can help me? http://prntscr.com/fs81lj
  3. Idea: Creating a marker on Map "Draqonlife" (gamemode play), which leads you to to another map. In this case "DraqonDocks" (gamemode race). known issues to be ignored: event triggers any marker known issues to be fixed: after gamemode change, the map wont change. Marker.lua : >Creates a marker (works) >Triggers player on entering and leaving any Marker (works) >Starts gamemode race (works) ! Does not start Map ! !! No error when map does not start !! !! ERROR: lobby/ChangeMode.lua:7: attempt to call global 'changeGamemodeMap' (a nil value) !! resourceRoot = getResourceRootElement() function onCurrentResourceStart(Draqonlife) local resourceName = getResourceName(Draqonlife) outputChatBox("Hello and welcome to " .. resourceName .. "!") Marker = createMarker (2860, -2115, 10, "corona", 4.0, 0, 0, 255, 255) -- create Marker end addEventHandler("onResourceStart", resourceRoot, onCurrentResourceStart) //Create Marker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local resource = getResourceFromName ("race") -- | this works, startResource( resource ) -- | really good tho --local resource = getResourceFromName ("DraqonDocks") --startResource( resource ) // If I try to start the map Resource directly after the race resource, // the Map resource wont load up end addEventHandler( "onMarkerHit", root, MarkerHit) //Should start gamemode race (and map) function MarkerLeave( leaveElement,matchingDimension) local elementType = getElementType( leaveElement ) local resource = getResourceFromName ("DraqonDocks") -- |Also not working, server ignores this line, startResource( resource ) -- |as it Ignores this line too. end addEventHandler( "onMarkerLeave", root, MarkerLeave ) ChangeMode.lua > My Idea to fix this problem --Thats why i want to import the mapmanager (or the function changeGamemodeMap) --Sadly I found no useful documentation for my case. --adding <exports.mapmanager:changeGamemodeMap/> to the meta.xml of the scripts didnt work function changeGamemodeMap() changeGamemodeMap("DraqonDocks", "race") -- this doesnt work end addCommandHandler("420", changeGamemodeMap) ___________________________________________________________________________________________ It would be very kind if someone could enlight me and give me a short introduction to using mapmanagers functions properly. Sadly the Mapmanager post in wiki didnt help me too much. If you find a fix for the existing (half working) Marker.lua, then I'd be really glad too I would love to get feedback and already thank everyone
  4. Hello, I have rented a server from clans.hu (not the best tbh) And I have uploaded the exact same resources from my win server, but they wont load screenshots:
  5. So, heres my table local twonodes = {"login", "rpteszt"} local thirdnodes = {[twonodes[1]] = {"username","password", "rememberMe"}, [twonodes[2]]={"rpteszt"}} local values = {thirdnodes[twonodes[1]]={"false"}} Seems good, right?Yeah, for u,but not for Lua... ERROR: Loading script failed: loginpanel/loginpanelC:112: '}' expected near '=''
  6. У меня ошибка в одном из скриптов. Дебаг показал: attempt to perform arithmetic on local ''priceWidth" (a boolean value) Сама строка: local hearderScale = math.min(1, (resolution.x - 60 - priceWidth) / hearderWidth) Уже который день мучусь помогите решить данную проблему. Вместо priceWidth Вставлял разные числа. эфекту 0
  7. Hey, I become a Error when i try to connect to a Server. Looks like that: --------------------------- MTA: San Andreas (CTRL+C to copy) --------------------------- Error loading 'CefWeb' module! Die angegebene Prozedur wurde nicht gefunden. Pls help
  8. I've been posting a lot here lately, and I am sorry if I'm getting annoying. But after a whole afternoon of trying to get my script to work I'd like to get some feedback. After I learned of the existence of debugging I immediatly went ahead and tried it. I almost fixed my script, but there's one problem keeping it from working Context: Player enters vehicle and an uzi is spawned and attached to the vehicle When the player presses left mouse button the uzi starts firing When the left mouse button is released the uzi should stop firing. function hydraFunctions() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 520 then outputChatBox ("Hydra guns installed") toggleControl ( "accelerate", true ) toggleControl ( "brake_reverse", true ) toggleControl ( "vehicle_secondary_fire", false ) toggleControl ( "vehicle_fire", false ) setControlState ( "special_control_up", true) toggleControl ( "special_control_down", false) local x, y, z = getElementPosition(vehicle) local weapon = createWeapon("uzi", x, y, z) local weaponHydraR = setElementData(vehicle, "weaponHydraR", weapon, true) attachElements ( weapon, vehicle, 0, 4, 1, 0, 0, 90) setWeaponClipAmmo(weapon, 500) setWeaponFiringRate(weapon, 90) end end end addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer(), hydraFunctions ) function hydraFiring() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 520 then if getElementData(vehicle, "weaponHydraR", true ) then setWeaponState(weapon, "firing") -- Can't seem to find the weapon outputChatBox ("guns activated") end end end end function hydraStopping() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 520 then if getElementData(vehicle, "weaponHydraR", true ) then setWeaponState(weapon, "ready") -- Can't seem to find the weapon outputChatBox ("guns deactivated") end end end end bindKey("mouse1", "down", hydraFiring) bindKey("mouse1", "up", hydraStopping) bindKey("lctrl", "down", hydraFiring) bindKey("lctrl", "up", hydraStopping) WARNING: 1947weapons\hydraweaponC.lua:41: Bad argument @ 'setWeaponState' [Expected weapon at argument 1, got nil] WARNING: 1947weapons\hydraweaponC.lua:28: Bad argument @ 'setWeaponState' [Expected weapon at argument 1, got nil] What I think is happening: The uzi spawns perfectly fine, but for some reason the following functions (hydraFiring & hydraStopping) cannot "detect" the uzi, hence the [Expected weapon at argument 1, got nil] error message. The uzi is simply not found. Also, I read on the forums that the setElementData and getElementData should only be used with more important data (which this isn't really I guess.) Is there an alternative that I can use? Thanks for your time, -Noah
  9. when i try this code it's never insert datas into database pls help me... ) -- root = getElementRoot() addEventHandler("onPlayerLogin", root, function(_, account) outputChatBox(getPlayerName(source).." Giriş yapti.", root) local oyuncu = getPlayerName(source) local ip = getPlayerIP(source) local serial = getPlayerSerial(source) local username = getAccountName(account) local result = dbPoll( dbQuery( userdata_db, "SELECT * FROM masterdata WHERE username = ?", username ), -1 ) if type(result) ~= 0 then outputChatBox("#afafaf[#f9a52fSA:MP#afafaf] #f9a52fVeritabanina bir veri eklenmedi.",root, 255, 255, 255, true ) else dbQuery( userdata_db, "INSERT INTO masterdata VALUES (?,?,?,?,?)",username,serial,ip, '',oyuncu) end end) Console Log : Username = Asokanta WARNING: mysql/serverside.lua:22: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] WARNING: mysql/serverside.lua:22: Bad argument @ 'dbPoll' [Expected dbquery at argument 1, got boolean] Username = deneme WARNING: mysql/serverside.lua:22: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] WARNING: mysql/serverside.lua:22: Bad argument @ 'dbPoll' [Expected dbquery at argument 1, got boolean] I Fixed Here* It's giving only login logs but it still don't insert data in database when result isn't 0 New Console Log : LOGIN: (Everyone, Console) Asokanta successfully logged in as 'Asokanta' LOGIN: (Everyone) Asokanta successfully logged in as 'deneme' Database Screenshot :
  10. Buenas, Estoy teniendo un error al momento de usar spawnPlayer, En el argumento uno no logro hacer que reconozca al jugador para spawnear. function deathspawn () fadeCamera ( getRootElement(), false, 2 ) setTimer( function() fadeCamera ( getRootElement(), true, 2 ) setCameraMatrix ( getRootElement(), 0, 0, 33, 100, 100, 3 ) spawnPlayer ( source, math.random (0,100), math.random (0,100), 10 ) -- Aqui esta el problema, no funciona con source, player o getrootelement end, 4000, 1) end addEventHandler ("onPlayerWasted", getRootElement(), deathspawn) Estaría muy agradecido de que me ayuden a encontrar el error, aun soy bastante novato.
  11. My mta play sounds but, in minutes the sound make a loop and don't stop, i'm restart the mta and in minutes begins again! In my old gta sa i had tha Proxy_sa.exe and don't have a problems, but i don't know to resolve the issue of sound! Thanks!
  12. Hi! My MTA always crashes on one server (American Villages Roleplay), with this error message: (It's partly english) Some people wrote on the server forum, that's because I using 32 bit Windows 7, not 64. But I've got a dual core processor, wich support only the 32 bit. What to do?
  13. The actual error message is on the screen-shot: http://prntscr.com/e7hjeq I forked current release from git to my local machine. Then I've run everything by "Build instruction" from readme.md. create-projects.bat was working only with regular rights - it returned "System cannot find path specified" error when running with admin rights. I compiled this thing using Visual Studio 2015 Build Tools (with Win 8.1 SDK). As I have x64 Win I used "VS2015 x64 Native Tools Command Line" shell. After compilation it returned 792 warnings and no errors. Also I've created a .bat file for final steps: " utils\premake5.exe install_data utils\premake5.exe install_resources pause" Can anyone suggest how to resolve this issue?
  14. Hey there, im here cause im having some issues with CEF Browser, the problem is that isn't showing the web-site color and i don't really know why. Original: MTA Browser:
  15. THE ERRORS ARE: WARNING!:bad argument "isPedInVehicle" [Expected ped at argument 1, got string "repair"] WARNING!:bad argument "outputChatBox" [Expected bool at argument 5, got number "0"] and my script is this: (the chatbox are in spanish) function mecanico ( thePlayer ) car= getPedOccupiedVehicle ( thePlayer ) if isPedInVehicle( thePlayer ) then outputChatBox("reparaste el auto correctamente", thePlayer, 255, 255, 0) fixVehicle( car ) else outputChatBox("No estas en el vehiculo para reparar el coche", thePlayer, 255, 0, 0) end end addEventHandler("onPlayerVehicleEnter", getRootElement(), mecanico) addCommandHandler("reparar", mecanico) any solution please??
  16. first error by: function createKillMessageGUI() local gap = config.iconHeight - config.textHeight gap = gap/2 for i=1,config.lines do local y = config.startY*screenY + (config.iconHeight*(i-1)) y = y + gap contentMessages[i] = { dxText:create("",0,y) } end endTime = config.fadeTime + config.startFade end -- second error by: function destroyLine ( line ) for k,part in ipairs(contentMessages[line]) do destroyWidget(part) end contentMessages[line] = {} end first error: killmessages\gui.lua:159: attempt to index global 'dxText' (a nil value) second error: killmessages\gui.lua:468: bad argument #1 to 'ipairs' (table expected, got nil) how to fix this? i tried fix, but doesn't working
  17. Hola, hace unos días estaba usando el "ModDownloader" (siempre lo uso y funciona correctamente), y al darle restart comenzó a darme errores y ningún skin/coche/arma se descargaba (Failed to download "..."), tengo un server con host y le pregunté ese mismo día al staff del servicio de host y me respondieron que quizá es por el FastDownloads que colocaron, la verdad es que no sé como arreglar esto..¿Hay alguna solución sin quitar el FastDownloads? Ayuda, por favor. Solo me pasa esto con el Moddownloader desde ese día. Gracias de antemano!
  18. hola mi gente, aqui tengo 1 error espero que me puedan ayudar, 1.- este error se trata de que aparece cuando alguien se sube a un vehiculo ( o nose pero a parece demaciadas veses -.-)
  19. So I Downloaded MTA:SA Today , unfortunatly I have this problem: first I get these messages:http://www2.0zz0.com/2017/01/12/19/274475443.pngthen when i press ok on the (Windows - Bad Image) message I get this message:http://www2.0zz0.com/2017/01/12/19/143617098.png please any help!
  20. Hello there, I've almost finished my vehicle shop / saving / control system but i got this error when i log out or reconnect: ERROR: wangcars/shop_server.lua:16: Couldn't convert userdata argument to JSON, only valid resources can be included for this function. I've tested and the result is table but toJSON says that it is userdata. It still saves it to accountdata in toJSON and i can unpack it with fromJSON. So is this mta bug or what? Saving function: addEventHandler("onPlayerLogout", root, function(account) local data = getElementData(source, "wangcars.data") if data then if account and not isGuestAccount(account) then if isElement(wangvehicle[source]) then local id = getElementData(wangvehicle[source], "wangcars.id") local x, y, z = getElementPosition(wangvehicle[source]) local rx, ry, rz = getElementRotation(wangvehicle[source]) data[id][6] = x..", "..y..", "..z..", "..rx..", "..ry..", "..rz data[id][8] = getElementHealth(wangvehicle[source]) setElementData(source, "wangcars.data", data) destroyElement(wangvehicle[source]) wangvehicle[source] = nil end setAccountData(account, "wangcars.data", toJSON(getElementData(source, "wangcars.data"))) -- error there, but it still saves it setElementData(source, "wangcars.data", false) triggerClientEvent(source, "wangcars.refreshgrid", source) end end end ) I have almost same function when player quit but no need to post it. I could just ignore this, but it's anoying because it always outputs error in debugscript when somebody disconnects and i'm trying to keep debug clean as possible.
  21. Hola, no sé si ésto irá acá pero lo pondré puesto a que no encontré otra sección para el mismo. Bueno, les cuento. Recién me enteré del Paradise R.P. por lo que traté hacerlo (ya que era con MySQL). Lo descargué, configuré y empezó todo bien pero el problema estuvo al momento de entrar ya que se quedó todo en negro y me banneó automáticamente por supuesto hack (cuyo mismo no tengo) de gravedad. Estuve leyendo y encontré que a un usuario de ésta misma comunidad le pasó una cosa parecida cuya misma solventó entrando a su base de datos, yendo a la tabla "wcf1_user", buscando su usuario y poniendo ceros. Entonces yo traté de solventarlo de la misma forma pero, para mi sorpresa, no está la dichosa tabla "wcf1_user". No sé qué hacer ya que es ban de serial y no me puedo desbannear. Ayuda, por favor. Así es como me aparece: No sé si les servirá de algo o no, pero éste es el link del post del usuario que tuvo el problema similar: Saludos y gracias de antemano.
  22. Hello guys again I have a idiot error in my server :)) Error: [2016-12-28 18:53:03] ERROR: DayZ\login.lua:284: bad argument #1 to 'ipairs' (table expected, got nil) Code : local spawnPositions = { {-278.6669921875,-2882.1572265625,32.104232788086}, {-958.5595703125,-2887.9912109375,64.82421875}, {-1816.9375,-2748.18359375,1.7327127456665}, {-2816.166015625,-2439.0546875,2.4004096984863}, {-2941.5673828125,-1206.2373046875,2.7848854064941}, {-2911.51171875,-895.22265625,2.4013109207153}, {-2185.6669921875,2957.380859375,11.474840164185}, {272.2265625,2928.505859375,1.3713493347168}, {2803.943359375,595.9365234375,7.7612648010254}, {2883.7509765625,-178.4658203125,3.2714653015137}, {-233.46484375,-1735.8173828125,1.5520644187927}, {-1056.8720703125,2939.068359375,42.311294555664}, } local playerDataTable = { {"alivetime"}, {"skin"}, {"MAX_Slots"}, {"bandit"}, {"blood"}, {"food"}, {"thirst"}, {"temperature"}, {"currentweapon_1"}, {"currentweapon_2"}, {"currentweapon_3"}, {"bleeding"}, {"brokenbone"}, {"pain"}, {"cold"}, {"infection"}, {"humanity"}, {"zombieskilled"}, {"headshots"}, {"murders"}, {"banditskilled"}, {"Wood Pile"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, {"Box of Matches"}, {"M1911 Mag"}, {"M9 SD Mag"}, {"Desert Eagle Mag"}, {"M1911"}, {"M9 SD"}, {"Winchester 1866"}, {"PDW"}, {"Hunting Knife"}, {"Hatchet"}, {"Pizza"}, {"Morphine"}, {"Soda Bottle"}, {"Empty Gas Canister"}, {"Full Gas Canister"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Grenade"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, {"PDW"}, --{"TEC-9"}, {"AK-47"}, --{"M136 Rocket Launcher"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, --{"Heat-Seeking RPG"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Scruffy Burgers"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Radio Device"}, {"Baseball Bat"}, {"Shovel"}, {"Golf Club"}, {"Radio Device"}, {"Parachute"}, } function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player),"playerID") account = getPlayerAccount(player) local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z") local skin = getAccountData(account,"skin") createZombieTable (player) if getAccountData(account,"isDead") then spawnDayZPlayer(player) return end spawnPlayer (player, x,y,z+0.5, math.random(0,360), skin, 0, 0) setElementFrozen(player, true) fadeCamera (player, true) setCameraTarget (player, player) setTimer( function(player) if isElement(player) then setElementFrozen(player, false) end end,500,1,player) playerCol = createColSphere(x,y,z,1.5) setElementData(player,"playerCol",playerCol) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) for i, v in ipairs ( clothSlots ) do local elementData = getAccountData(account,v) setElementData(player,v,elementData) if type(elementData) == "string" then local objData = clothesObjects[elementData] if objData then local helmet = createObject(objData[1], x, y, z) setElementData ( source, v.."Object", helmet ) attachElementToBone(helmet, source, objData[2], objData[3], objData[4], objData[5], objData[6], objData[7], objData[8]) end end end for i,data in ipairs(playerDataTable) do local elementData = getAccountData(account,data[1]) if not elementData then if data[1] == "brokenbone" or data[1] == "pain" or data[1] == "cold" or data[1] == "infection" or data[1] == "currentweapon_1" or data[1] == "currentweapon_2" or data[1] == "currentweapon_3" or data[1] == "bandit" then elementData = elementData else elementData = 0 end end setElementData(player,data[1],elementData) end setElementData(player,"logedin",true) --Weapons --Old Weapons local weapon = getElementData(player,"currentweapon_1") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), true ) end local weapon = getElementData(player,"currentweapon_2") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end local weapon = getElementData(player,"currentweapon_3") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end setElementModel(player, getElementData(player,"skin")) setElementData(player,"admin",getAccountData(account,"admin") or false) setElementData(player,"supporter",getAccountData(account,"supporter") or false) triggerClientEvent(player, "onClientPlayerDayZLogin", player) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) function playerRegister(username, pass, player) local number = math.random(table.size(spawnPositions)) local x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3] spawnPlayer (player, x,y,z, math.random(0,360), 281, 0, 0) fadeCamera (player, true) setCameraTarget (player, player) playerCol = createColSphere(x,y,z,1.5) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) ---------------------------------- --Player Items on Start for i,data in ipairs(playerDataTable) do if data[1] =="Bandaj" then setElementData(player,data[1],2) elseif data[1] =="Ağrı Kesici" then setElementData(player,data[1],1) elseif data[1] =="MAX_Slots" then setElementData(player,data[1],8) elseif data[1] =="skin" then setElementData(player,data[1],281) elseif data[1] =="blood" then setElementData(player,data[1],12000) elseif data[1] =="temperature" then setElementData(player,data[1],37) elseif data[1] =="brokenbone" then setElementData(player,data[1],false) elseif data[1] =="pain" then setElementData(player,data[1],false) elseif data[1] =="cold" then setElementData(player,data[1],false) elseif data[1] =="infection" then setElementData(player,data[1],false) elseif data[1] =="food" then setElementData(player,data[1],100) elseif data[1] =="thirst" then setElementData(player,data[1],100) elseif data[1] =="currentweapon_1" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_2" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_3" then setElementData(player,data[1],false) elseif data[1] =="bandit" then setElementData(player,data[1],false) elseif data[1] =="humanity" then setElementData(player,data[1],2500) else setElementData(player,data[1],0) end end account = getAccount(username) local value = getAccounts() local value = #value setElementData(player,"playerID",value+1) setAccountData(account,"playerID",value+1) setElementData(player,"logedin",true) createZombieTable (player) end addEvent("onPlayerDayZRegister", true) addEventHandler("onPlayerDayZRegister", getRootElement(), playerRegister) function saveAccounts () -- Save in the database local account = getPlayerAccount(source) if account then for i,data in ipairs(playerDataTable) do setAccountData(account,data[1],getElementData(source,data[1])) end for i, v in ipairs ( clothSlots ) do setAccountData(account,v,getElementData(source,v)) end local x,y,z = getElementPosition(source) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) destroyElement(getElementData(source,"playerCol")) end setElementData(source,"logedin",false) end addEventHandler ( "onPlayerQuit", getRootElement(), saveAccounts ) function saveAccounts2 () -- Save in the database for i, player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account then for i,data in ipairs(playerDataTable) do setAccountData(account,data[1],getElementData(player,data[1])) end for i, v in ipairs ( clothSlots ) do setAccountData(account,v,getElementData(source,v)) end local x,y,z = getElementPosition(player) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) end --setElementData(player,"logedin",false) end end addEventHandler ( "onResourceStop", getRootElement(), saveAccounts2 ) -------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------- local vehicleDataTable = { {"MAX_Slots"}, {"Tire_inVehicle"}, {"Engine_inVehicle"}, {"Parts_inVehicle"}, {"fuel"}, {"Wood Pile"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, {"Box of Matches"}, {"M1911 Mag"}, {"M1911"}, {"M9 SD"}, {"Desert Eagle Mag"}, {"Winchester 1866"}, {"PDW"}, {"Hunting Knife"}, {"Morphine"}, {"Hatchet"}, {"Pizza"}, {"Soda Bottle"}, {"Empty Gas Canister"}, {"Full Gas Canister"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Grenade"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, --{"TEC-9"}, {"AK-47"}, --{"M136 Rocket Launcher"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, --{"Heat-Seeking RPG"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Scruffy Burgers"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Assault Pack (ACU)"}, {"Alice Pack"}, {"Czech Backpack"}, {"Coyote Backpack"}, {"Radio Device"}, {"Baseball Bat"}, {"Shovel"}, {"Golf Club"}, {"Parachute"}, } --local vehicleManager = getAccount("vehicleManager","ds4f9$") --if not vehicleManager then --addAccount("vehicleManager","ds4f9$") --end function saveallvehicles(ps,command) counter = 0 counterTent = 0 --counterSafe = 0 local vehicleManager = getAccount("vehicleManager","Lfybkxbybxrby112") --local vehicleManager = getAccount("vehicleManager") for i, col in ipairs (getElementsByType("colshape")) do local veh = getElementData(col,"vehicle") local helicrash = getElementData(col,"helicrash") local hospitalbox = getElementData(col,"hospitalbox") --local ammobox = getElementData(col,"ammobox") local tent = getElementData(col,"tent") -- local safe = getElementData ( col,"safe") if veh and not helicrash or veh and not hospitalbox then if tent then counterTent = counterTent +1 account = getAccount("tent_number_"..counterTent,"Lfybkxbybxrby112") or false if not account then account = addAccount("tent_number_"..counterTent,"Lfybkxbybxrby112") end local tent = getElementData(col,"parent") local x,y,z = getElementPosition(tent) local rx,ry,rz = getElementRotation(tent) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) setAccountData(account,"last_rx",rx) setAccountData(account,"last_ry",ry) setAccountData(account,"last_rz",rz) for i, data in ipairs(vehicleDataTable) do setAccountData(account,data[1],getElementData(col,data[1])) end else counter = counter +1 account = getAccount("vehicle_number_"..counter,"ds4f9$") or false if not account then account = addAccount("vehicle_number_"..counter,"ds4f9$") end setAccountData(account,"spawn_x",getElementData(col,"spawn")[2]) setAccountData(account,"spawn_y",getElementData(col,"spawn")[3]) setAccountData(account,"spawn_z",getElementData(col,"spawn")[4]) for i, data in ipairs(vehicleDataTable) do setAccountData(account,data[1],getElementData(col,data[1])) end local vehicle = getElementData(col,"parent") local model = getElementModel(vehicle) local x,y,z = getElementPosition(vehicle) local rx,ry,rz = getElementRotation(vehicle) local health = getElementHealth(vehicle) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) setAccountData(account,"last_rx",rx) setAccountData(account,"last_ry",ry) setAccountData(account,"last_rz",rz) setAccountData(account,"health",health) setAccountData(account,"model",model) setAccountData(account,"isExploded",getElementData(vehicle,"isExploded") or false) end end end setAccountData(vehicleManager,"vehicleamount",counter) setAccountData(vehicleManager,"tentamount",counterTent) end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) function doBackup () --outputChatBox ("Резервное копирование сервера. Просим не выходить с сервера во Yaşam Süresi NETWORK.",getRootElement(),27, 89, 224,true) saveallvehicles() --outputChatBox ("Продолжайте!",getRootElement(),27, 89, 224,true) end function checkDoBackup () if gameplayVariables["backupenabled"] then setTimer(doBackup,gameplayVariables["backupinterval"],0) end end checkDoBackup() function createVehicleOnServerStart() local vehicleManager = getAccount("vehicleManager","ds4f9$") for i = 1, (getAccountData(vehicleManager,"vehicleamount") or 0) do wastedVehicle = false vehicle = getAccount("vehicle_number_"..i,"ds4f9$") if not vehicle then break end if getAccountData(vehicle,"isExploded") == true then setAccountData(vehicle,"health",1000) wastedVehicle = true end local veh = createVehicle(getAccountData(vehicle,"model"),getAccountData(vehicle,"last_x"),getAccountData(vehicle,"last_y"),getAccountData(vehicle,"last_z"),getAccountData(vehicle,"last_rx"),getAccountData(vehicle,"last_ry"),getAccountData(vehicle,"last_rz")) vehCol = createColSphere(getAccountData(vehicle,"last_x"),getAccountData(vehicle,"last_y"),getAccountData(vehicle,"last_z"),4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",getAccountData(vehicle,"MAX_Slots")) xxx,yyy,zzz = getAccountData(vehicle,"spawn_x"),getAccountData(vehicle,"spawn_y"),getAccountData(vehicle,"spawn_z") setElementData(vehCol,"spawn",{getAccountData(vehicle,"model"),xxx,yyy,zzz}) if wastedVehicle then if getAccountData(vehicle,"model") == 497 then item_id = math.random(table.size(hunterSpawns)) xxx,yyy,zzz = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3] end if getAccountData(vehicle,"model") == 487 then local item_id = math.random(table.size(maverikSpawns)) x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3] end setElementPosition(veh,xxx,yyy,zzz+1) setElementRotation(veh,0,0,0) --Motor + Tekerlek + Yakıt Deposu local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tekerlek_inVehicle",math.random(0,tires)) setElementData(vehCol,"Motor_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) end --others setElementData(vehCol,"fuel",getAccountData(vehicle,"fuel")) if not wastedVehicle then for i, data in ipairs(vehicleDataTable) do setElementData(vehCol,data[1],getAccountData(vehicle,data[1])) end else if getElementModel(veh) == 433 or getElementModel(veh) == 470 then for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],math.random(1,2)) end end end setElementData(vehCol,"fuel",10) end end for i = 1, (getAccountData(vehicleManager,"tentamount") or 0) do tentData = getAccount("tent_number_"..i,"ds4f9$") if not tentData then break end tent = createObject(3243,getAccountData(tentData,"last_x"),getAccountData(tentData,"last_y"),getAccountData(tentData,"last_z"),0,0,(getAccountData(tentData,"last_rz") or 0)) setObjectScale(tent,1.3) tentCol = createColSphere(getAccountData(tentData,"last_x"),getAccountData(tentData,"last_y"),getAccountData(tentData,"last_z"),4) attachElements ( tentCol, tent, 0, 0, 0 ) setElementData(tentCol,"parent",tent) setElementData(tent,"parent",tentCol) setElementData(tentCol,"tent",true) setElementData(tentCol,"vehicle",true) setElementData(tentCol,"MAX_Slots",100) for i, data in ipairs(vehicleDataTable) do setElementData(tentCol,data[1],getAccountData(tentData,data[1])) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), createVehicleOnServerStart)
  23. function playbotvok1(message,messageType) if message == "hogy lehet rangom" or message == "hogy lehet rangom?" or message == "Hogy lehet rangom" or message == "Hogy lehet rangom ?" or message "hogy lehet rangom?" or message == "hogy lehet rangom ?" or message == "Hogy lehet rangom?" or message == "Lehetek rangos?" or message == "lehetek rangos" or message == "lehetek rangos?" or message == "Lehetek rangos?" then outputChatBox( "#14B866[M] #FF699CPlaybot#898395: #808080Rangot tudsz venni. F10 gombot ha megnyomod, megtalálod az infókat a vásárláshoz. (#ffFFff"..getPlayerName(source).."#808080)", root, 255, 0, 0, true ) end end addEventHandler("onPlayerChat",getRootElement(),playbotvok1) function fegyverrol(message,messageType) if message == "hogy szerezzek fegyvert" or message == "hogy szerezzek fegyvert?" or message == "Hogy szerezzek fegyvert" or message == "Hogy szerezzek fegyvert ?" or message "hogy szerezzek fegyot?" or message == "hogy szerezzek fegyót ?" or message == "Hogy szerezzek fegyót?" or message == "hogy lehet fegyverem?" or message == "hogy lehet fegyom?" or message == "hol lehet venni fegyvert?" or message == "hol lehet venni fegyvert" or message == "Hol lehet venni fegyvert?" or message == "Hol lehet venni fegyvert" or message == "Hol lehet venni fegyvert ?" then outputChatBox( "#14B866[M] #FF699CPlaybot#898395: #808080Fegyvert kétféle módon lehet szerezni. Egyik: F7, másik, hogy keresel! (#ffFFff"..getPlayerName(source).."#808080)", root, 255, 0, 0, true ) end end addEventHandler("onPlayerChat",getRootElement(),fegyverrol) Error: attempt to call local 'message' (a string value) but script is working fine... how to fix this? i tried "local = message { }" but same error...
  24. sql

    Hi guys, I'm trying to make a execute query function, this is what I got. But I seem to be doing something wrong. Server sided addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() connection = dbConnect(dbInfo["databaseType"], "dbname="..dbInfo["dbname"]..";host="..dbInfo["host"], dbInfo["username"], dbInfo[password]) if connection then outputDebugString("Connection with database was successfully established.") else outputDebugString("Connection with database couldn't be established.") end end) function execQuery (queryString) local query = dbQuery(connection, tostring(queryString)) if (string.find(queryString, "SELECT")) then local result = dbPoll(query, -1 ) if not result == nil then return result end end dbFree(query) end This I have server sided in another file for testing my db addEventHandler ("onPlayerJoin", getRootElement(), function () local query = execQuery("SELECT username FROM users WHERE username = '"..getPlayerName(source) .."'") if (query) then outputChatBox("found username: "..tostring(query[0])) else outputChatBox("didn't found username, inserting!") execQuery("INSERT INTO users VALUES('', '"..getPlayerName(source).."')") end end ) Also I'm not quite sure how to get the value since I'm returning a table atm. Kind regards P.S. my database looks like this
  25. Here is a screenshot of the error message (console) here are the lines that cause problem: not sure what's wrong, I didn't write the code, and sadly I have no clue how to fix it..