SparkySky

Members
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Neutral

About SparkySky

  • Rank
    Square
  • Birthday 04/03/1991

Details

  • Gang
    20CM
  • Location
    România
  • Occupation
    Creating video content for internet !

Recent Profile Visitors

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

  1. Thanks anyway, I'll see what I can do!
  2. I found out that in the database to work /ads you have to enter the following codes ! -- -------------------------------------------------------- -- -- Structura de tabel pentru tabelul `advertisements` -- CREATE TABLE `advertisements` ( `id` int(11) NOT NULL, `phone` varchar(10) NOT NULL, `name` varchar(50) NOT NULL, `address` varchar(100) NOT NULL, `advertisement` text NOT NULL, `start` int(11) NOT NULL, `expiry` int(11) NOT NULL, `created_by` int(11) NOT NULL, `section` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Salvarea datelor din tabel `advertisements` -- INSERT INTO `advertisements` (`id`, `phone`, `name`, `address`, `advertisement`, `start`, `expiry`, `created_by`, `section`) VALUES -- -------------------------------------------------------- -- -- Indexes for table `advertisements` -- ALTER TABLE `advertisements` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for table `advertisements` -- ALTER TABLE `advertisements` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=697; I put it in and when I gave /ads it tells me to wait 2 hours to place an ad! I gave /forcepaydayall to have 2 hours and when I give /ads again I get this error in the console ?! ERROR: advertisements\advertisements.Lua:187: bad argument #1 to 'ipairs' (table expected, got boolean) ERROR: advertisements\advertisements.Lua:187: call: failed to call 'mysql:select' [string "?"] how can i solve ?! please help me !
  3. local SCREEN_X, SCREEN_Y = guiGetScreenSize() local resourceName = getResourceName( getThisResource( ) ) local ONE_HOUR = 3600 local SERVICES_SECTION = 1 --Places to offer services such as house cleaning or mechanics and whatnot local CARS_VEHICLES_SECTION = 2 --Offer to buy or sell a vehicle in this section local REAL_ESTATE_SECTION = 3 --Houses for sale go in this section local COMMUNITY_SECTION = 4 --Advertisements about communities can go here, for example, palomino creek. local JOBS_SECTION = 5 --Advertisements about hiring people or looking for work will go in this section local PERSONALS_SECTION = 6 --People looking for other people go in this section local sections = { "Servicii", "Vehicule", "Proprietăți", "Communitate", "Slujbe", "Personal" } local deleteAny = false local window = { } local viewad = {} local postad = {} function getTime( day, month, timestamp ) local months = { "Ianuarie", "Februarie", "Martie", "Aprile", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octobrie", "Niembrie", "Decembrie" } local days = { "Sâmbătă", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Duminică" } local time = nil local ts = nil if timestamp then time = getRealTime( timestamp ) else time = getRealTime( ) end ts = ( tonumber( time.hour ) >= 12 and tostring( tonumber( time.hour ) - 12 ) or time.hour ) .. ":"..("%02d"):format(time.minute)..( tonumber( time.hour ) >= 12 and " PM" or " AM" ) if month then ts = months[ time.month + 1 ] .. " ".. time.monthday .. ", " .. ts end if day then ts = days[ time.weekday + 1 ].. ", " .. ts end return ts end addEvent( resourceName .. ":ad_create_fail", true ) addEventHandler( resourceName .. ":ad_create_fail", root, function() local window = { } --Store all of our window elements local width = 230 -- The width of our window local height = 110 -- The height of our window local x = SCREEN_X / 2 - width / 2 --Where on the screen our window will be located local y = SCREEN_Y / 2 - height / 2 window.window = guiCreateWindow( x, y, width, height, "Eroare de creatie", false ) --Create the window. window.errorLabel = guiCreateLabel( 10, 30, width - 20, 20, "A fost o eroare la introducere.", false, window.window ) window.closeButton = guiCreateButton( 10, 60, width - 20, 40, "Ieși", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () guiSetVisible( window.window, false ) destroyElement( window.window ) window = { } end ) end ) function createAdvertisement( ) closePostAd() if window and window.window and isElement(window.window) then guiSetEnabled(window.window, false) end guiSetInputEnabled ( true ) local window = { } -- Store all of our window elements local width = 400 -- The width of our window local height = 440 -- The height of our window local x = SCREEN_X / 2 - width / 2 --Where on the screen our window will be located local y = SCREEN_Y / 2 - height / 2 postad.window = guiCreateWindow( x, y, width, height, "Crează Reclamă", false ) --Create the postad. postad.label = { } --This will hold our label elements local labels = { "Telefon", "Nume", "Adresă", "Expiră", "Secțiune", "Reclamă" } --This holds all of the labels we will create here local y = 35 --We'll set y to 30, which is the y coordinate of where our first label will go. for label = 1, #labels do postad.label[ label ] = guiCreateLabel( 10, y * label, 100, 30, labels[ label ], false, postad.window ) end postad.input = { } -- Will hold all of our input elements. y = 30 -- We'll start y off at 25 here to stay even with the inputs. postad.input[ 1 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Phone input y = y + 35 postad.input[ 2 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Name Input y = y + 35 postad.input[ 3 ] = guiCreateEdit( 100, y, width - 120, 30, "", false, postad.window ) --Address input y = y + 40 postad.input[ 4 ] = guiCreateComboBox( 100, y, width - 120, 95, "", false, postad.window ) --Expiry guiComboBoxAddItem( postad.input[ 4 ], "1 oră" ) guiComboBoxAddItem( postad.input[ 4 ], "2 ore" ) guiComboBoxAddItem( postad.input[ 4 ], "6 ore" ) guiComboBoxAddItem( postad.input[ 4 ], "O zi" ) y = y + 34 postad.input[ 5 ] = guiCreateComboBox( 100, y, width - 120, 125, "", false, postad.window ) --Section for i = 1, #sections do --Loop through each of the 6 advertisement sections. guiComboBoxAddItem( postad.input[ 5 ], sections[ i ] ) end postad.input[ 6 ] = guiCreateMemo( 10, y + 60, width - 20, 90, "", false, postad.window ) --Advertisement for i = 1, 6 do addEventHandler(getElementType( postad.input[i] ) == 'gui-combobox' and 'onClientGUIComboBoxAccepted' or 'onClientGUIChanged', postad.input[i], function( ) for i = 1, 6 do if getElementType( postad.input[i] ) == 'gui-combobox' then if guiComboBoxGetSelected( postad.input[i] ) == -1 then guiSetEnabled( postad.postButton, false ) return end else local text = ( guiGetText( postad.input[i] ) or '' ):gsub("\n", ''):gsub("\r", '') if #text == 0 then guiSetEnabled( postad.postButton, false ) return end end end guiSetEnabled( postad.postButton, true ) end, false ) end postad.postButton = guiCreateButton( 10, height - 100, width - 20, 40, "Postează Reclamă", false, postad.window ) guiSetEnabled( postad.postButton, false ) addEventHandler( "onClientGUIClick", postad.postButton, function () local phone = guiGetText( postad.input[ 1 ] ) or "" local name = guiGetText( postad.input[ 2 ] ) or "" local address = guiGetText( postad.input[ 3 ] ) or "" local advertisement = guiGetText( postad.input[ 6 ] ) local expirySelected = guiComboBoxGetSelected( postad.input[ 4 ] ) local expires = nil if expirySelected == -1 or expirySelected == 0 then expires = ONE_HOUR elseif expirySelected == 1 then expires = ONE_HOUR * 2 elseif expirySelected == 2 then expires = ONE_HOUR * 6 else expires = ONE_HOUR * 24 end local section = tostring( guiComboBoxGetSelected( postad.input[ 5 ] ) + 1 ) closePostAd() triggerServerEvent( resourceName .. ":create_advertisement", getLocalPlayer(), phone, name, address, advertisement, expires, section ) end , false ) postad.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, postad.window ) addEventHandler( "onClientGUIClick", postad.closeButton, function () if source == postad.closeButton then closePostAd() end end , false ) end addCommandHandler( "postad", createAdvertisement, false, false ) function closePostAd() if postad and postad.window and isElement(postad.window) then guiSetInputEnabled ( false ) destroyElement( postad.window ) postad = { } if window and window.window and isElement(window.window) then guiSetEnabled(window.window, true) else showCursor( false, false ) end end end function viewAdvertisement( advertisement ) closeViewAd() if window and window.window and isElement(window.window) then guiSetEnabled(window.window, false) end guiSetInputEnabled ( false ) local window = { } local width = 400 local height = 530 local x = SCREEN_X / 2 - width / 2 local y = SCREEN_Y / 2 - height / 2 viewad.window = guiCreateWindow( x, y, width, height, "Vezi reclamă", false ) viewad.label = { } local labels = { "Telefon", "Nume", "Adresă", "Start", "Expiră", "Secțiune", "Reclamă" } local y = 35 for label = 1, #labels do viewad.label[ label ] = guiCreateLabel( 10, y * label, 100, 30, labels[ label ], false, viewad.window ) end viewad.input = { } y = 30 viewad.input[ 1 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.phone, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 1 ], true ) y = y + 35 viewad.input[ 2 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.name, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 2 ], true ) y = y + 35 viewad.input[ 3 ] = guiCreateEdit( 100, y, width - 120, 30, advertisement.address, false, viewad.window ) guiEditSetReadOnly( viewad.input[ 3 ], true ) y = y + 35 viewad.input[ 4 ] = guiCreateEdit( 100, y, width - 120, 30, getTime( true, true, advertisement.start ), false, viewad.window ) guiEditSetReadOnly( viewad.input[ 4 ], true ) y = y + 35 viewad.input[ 5 ] = guiCreateEdit( 100, y, width - 120, 30, getTime( true, true, advertisement.expiry ), false, viewad.window ) guiEditSetReadOnly( viewad.input[ 5 ], true ) y = y + 35 viewad.input[ 6 ] = guiCreateEdit( 100, y, width - 120, 30, sections[ tonumber( advertisement.section ) ], false, viewad.window ) guiEditSetReadOnly( viewad.input[ 6 ], true ) viewad.input[ 7 ] = guiCreateMemo( 10, y + 60, width - 20, 90, advertisement.advertisement, false, viewad.window ) guiMemoSetReadOnly( viewad.input[ 7 ], true ) if tonumber( getElementData( localPlayer, "dbid" ) ) == tonumber( advertisement.created_by ) or deleteAny then guiCreateLabel( 100, 245, 200, 25, "Creat de: " .. advertisement.author:gsub("_", " "), false, viewad.window ) viewad.pushButton = guiCreateButton( 10, height - 150, width - 20, 40, "Trimite reclama ($100)", false, viewad.window ) if tonumber( getElementData( localPlayer, "dbid" ) ) ~= tonumber( advertisement.created_by ) then guiSetProperty( viewad.pushButton, 'NormalTextColour', 'FFFF0000' ) end addEventHandler( "onClientGUIClick", viewad.pushButton, function () triggerServerEvent( resourceName .. ":push_advertisement", localPlayer, advertisement.id ) end , false ) end if tonumber( getElementData( localPlayer, "dbid" ) ) == tonumber( advertisement.created_by ) or deleteAny then viewad.deleteButton = guiCreateButton( 10, height - 100, width - 20, 40, "Șterge Reclamă", false, viewad.window ) if tonumber( getElementData( localPlayer, "dbid" ) ) ~= tonumber( advertisement.created_by ) then guiSetProperty( viewad.deleteButton, 'NormalTextColour', 'FFFF0000' ) end addEventHandler( "onClientGUIClick", viewad.deleteButton, function () closeViewAd() triggerServerEvent( resourceName .. ":delete_advertisement", localPlayer, advertisement.id ) end , false ) end viewad.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, viewad.window ) addEventHandler( "onClientGUIClick", viewad.closeButton, function () if source == viewad.closeButton then closeViewAd() end end , false ) end function closeViewAd() if viewad and viewad.window and isElement(viewad.window) then guiSetInputEnabled ( false ) guiSetVisible( viewad.window, false ) destroyElement( viewad.window ) viewad = { } if window and window.window and isElement(window.window) then guiSetEnabled(window.window, true) else showCursor( false, false ) end end end addEvent( resourceName .. ":display_all", true ) addEventHandler( resourceName .. ":display_all", root, function( advertisements, canDeleteAnyAd ) closeAds() deleteAny = canDeleteAnyAd showCursor( true, true ) local width = 500 local height = 500 local x = SCREEN_X / 2 - width / 2 local y = SCREEN_Y / 2 - height / 2 window.window = guiCreateWindow( x, y, width, height, "Reclame", false ) window.closeButton = guiCreateButton( 10, 30, width - 20, 40, "Creează Reclamă", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () createAdvertisement( ) end , false ) window.mainPanel = guiCreateTabPanel ( 10, 90, width - 15, height - 150, false, window.window ) window.tab = { } window.table = { } window.colPhone = { } window.colName = { } window.colAd = { } for i = 1, #sections do window.tab[ i ] = guiCreateTab( sections[ i ], window.mainPanel ) window.table[ i ] = guiCreateGridList ( 10, 10, width - 35, height - 190, false, window.tab[ i ] ) window.colPhone[ i ]= guiGridListAddColumn( window.table[ i ], "Telefon", 0.2 ) window.colName[ i ] = guiGridListAddColumn( window.table[ i ], "Nume", 0.2 ) window.colAd[ i ] = guiGridListAddColumn( window.table[ i ], "Reclamă", 0.5 ) for ad = 1, #advertisements do if tonumber( advertisements[ ad ].section ) == i then local row = guiGridListAddRow ( window.table[ i ] ) guiGridListSetItemText( window.table[ i ], row, window.colPhone[ i ], advertisements[ ad ].phone, false, false ) guiGridListSetItemText( window.table[ i ], row, window.colName[ i ], advertisements[ ad ].name, false, false ) guiGridListSetItemText( window.table[ i ], row, window.colAd[ i ], advertisements[ ad ].advertisement, false, false ) guiGridListSetItemData( window.table[ i ], row, window.colPhone[ i ], ad ) addEventHandler( "onClientGUIDoubleClick", window.table[ i ], function ( button, state ) if button == 'left' and state == 'up' and window and window.table then local selectedRow, selectedCol = guiGridListGetSelectedItem( window.table[ i ] ) local key = guiGridListGetItemData( window.table[ i ], selectedRow, window.colPhone[ i ] ) if advertisements[ key ] then viewAdvertisement( advertisements[ key ] ) end end end , false ) end end if guiGridListGetRowCount( window.table[ i ] ) == 0 then local row = guiGridListAddRow ( window.table[ i ] ) guiGridListSetItemText ( window.table[ i ], row, window.colPhone[ i ], "Nici-o reclamă", false, false ) end end window.closeButton = guiCreateButton( 10, height - 50, width - 20, 40, "Ieși", false, window.window ) addEventHandler( "onClientGUIClick", window.closeButton, function () if source == window.closeButton then closeAds() end end , false ) end ) function closeAds() if window and window.window and isElement(window.window) then showCursor( false, false ) destroyElement( window.window ) window = { } closePostAd() end end local SERVICES_SECTION = 1 --Places to offer services such as house cleaning or mechanics and whatnot local CARS_VEHICLES_SECTION = 2 --Offer to buy or sell a vehicle in this section local REAL_ESTATE_SECTION = 3 --Houses for sale go in this section local COMMUNITY_SECTION = 4 --Advertisements about communities can go here, for example, palomino creek. local JOBS_SECTION = 5 --Advertisements about hiring people or looking for work will go in this section local PERSONALS_SECTION = 6 --People looking for other people go in this section local COOLDOWN_MINUTES = 5 --Number of minutes between push alerts being sent by players local resourceName = getResourceName( getThisResource( ) ) local sections = { "Servicii", "Vehicule", "Proprietăți", "Communitate", "Slujbe", "Personal" } function escape( value ) return exports.mysql:escape_string( value ) end function now( ) return tonumber( getRealTime().timestamp ) end addEvent( resourceName .. ":create_advertisement", true ) addEventHandler( resourceName .. ":create_advertisement", root, function( phone, name, address, advertisement, expires, section ) --Check if all fields have been entered by the user. if not ( phone == nil or name == nil or address == nil or advertisement == nil ) then --Fetch the created by local createdBy = tostring( getElementData( source, "dbid" ) ) --Get the current server time to store as our start time local start = getRealTime().timestamp --Add the time until expiry to the start time to get the actual time it will expire. local expiry = start + expires --Check if our query went into the database successfully. if exports.mysql:insert( 'advertisements', { phone = phone, name = name, address = address, advertisement = advertisement, start = start, expiry = expiry, section = section, created_by = createdBy } ) then --We'll send something to the client side so they can close the add form and reopen the main advertisements form. --openAdvertisements( source, nil ) else --If the database query was unsucessful, alert the end user. outputChatBox( "SQL Error.", source ) triggerClientEvent( source, resourceName .. ":ad_create_fail", root ) end else --If all fields were not entered, alert the user. outputChatBox( "Field Error.", source ) triggerClientEvent( source, resourceName .. ":ad_create_fail", root ) end end ) local coolDown = {} addEvent( resourceName .. ":push_advertisement", true ) addEventHandler( resourceName .. ":push_advertisement", root, function( id ) local advertisement = exports.mysql:select_one( "advertisements", { id = id } ) advertisement.author = exports.mysql:select_one( "characters", { id = advertisement.created_by } ).charactername if not coolDown[ id ] or ( coolDown[ id ] < now() - ( 60 * COOLDOWN_MINUTES ) ) then if exports.bank:takeBankMoney( client, 100 ) then coolDown[ id ] = now() for i, k in pairs( getElementsByType( 'player' ) ) do if exports.integration:isPlayerTrialAdmin( k ) then outputChatBox( "ADVERT: " .. advertisement.advertisement .. " | Ph: " .. advertisement.phone .. " | Cat: " .. sections[ tonumber( advertisement.section ) ] .. " (( " .. advertisement.author:gsub("_", " ") .." )) .", k, 0, 255, 0 ) else outputChatBox( "ADVERT: " .. advertisement.advertisement .. " | Ph: " .. advertisement.phone .. " | Cat: " .. sections[ tonumber( advertisement.section ) ] .. ".", k, 0, 255, 0 ) end end else outputChatBox( "Nu ai destui bani în bancă să trimiți această reclamă.", client, 255, 155, 155 ) end else outputChatBox( "Poți trimite o reclamă o dată la " .. COOLDOWN_MINUTES .. " minute.", client, 255, 155, 155 ) end end ) function deleteAdvertisement( id ) return exports.mysql:delete('advertisements', {id = id}) end addEvent( "advertisements:delete_advertisement", true ) addEventHandler( "advertisements:delete_advertisement", getRootElement(), function( id ) if deleteAdvertisement( id ) then --openAdvertisements( source ) else outputChatBox( "An error occured with deleting that ad.", source, 255, 100, 100 ) end end ) function openAdvertisements( player, command ) local advertisements = { } --These will hold our advertisements to send to the client and populate our advertisement tables. if not player then player = source end for _, ad in ipairs( exports.mysql:select('advertisements') ) do if tonumber( ad.expiry ) >= tonumber( getRealTime().timestamp ) then --Check if the advertisement has expired, delete it if so. ad.author = exports.mysql:select_one( "characters", { id = ad.created_by } ).charactername table.insert( advertisements, ad ) else deleteAdvertisement( ad.id ) end end triggerClientEvent( player, resourceName .. ":display_all", root, advertisements, exports.integration:isPlayerAdmin( player ) ) --Send the advertisements to the client to create the GUI. end addCommandHandler( "advertisements", openAdvertisements, false, false ) addCommandHandler( "ads", openAdvertisements, false, false ) addCommandHandler( "classifieds", openAdvertisements, false, false ) addEvent( resourceName .. ":open_ads", true ) addEventHandler( resourceName .. ":open_ads", root, openAdvertisements ) Hello guys I just wanna know what I messed up in my script I'm facing this error for hours!! ERROR: advertisements\advertisements.Lua:187: call: failed to call 'mysql:select' [string "?"] ERROR: advertisements\advertisements.Lua:187: bad argument #1 to 'ipairs' (table expected, got boolean)
  4. și cum pot scăpa de costum weapons?
  5. Salutare Tuturor! Vreau să întreb cum pot remedia o greșeală cu o armă? Am 2 arme într-o armă, una originală și una modificată? !! cum pot rezolva asta ?! În ce fișier ar trebui rezolvată problema cu o eroare de armă? Iată o imagine a modului meu de joc DayZ! Aceasta este versiunea 0.7b! https://imgur.com/a/nddULJg https://imgur.com/a/wcr9pVY Mie mi-a spus cineva că trebuie de rezolvat în core.Lua și core_client.Lua ! Uitați fișierele aici ! https://www.mediafire.com/file/brgoz8ebc2g06jn/core_client.Lua/file https://www.mediafire.com/file/ev34e1kbsrzapxj/core.Lua/file Mulțumesc Anticipat !
  6. Hello! I want to ask how can I fix a mistake with a weapon? Do I have 2 weapons in weapons, one original and one modified? !! how can i solve this ?! In which file should the problem with a weapon error be resolved? Here is a picture of my DayZ game mode! This is version 0.7b! https://imgur.com/a/nddULJg https://imgur.com/a/wcr9pVY
  7. ready I already solved the problem with / kill! but I have a problem at the core.Lua with the backpack when my skin changes then my backpack disappears! how can i solve it ?! Thank you in advance ! https://www.mediafire.com/file/vj71yzyj3bk5c4t/core.Lua/file
  8. function spawnDayZPlayer(player) if player then local x,y,z = unpack(spawnPositions[math.random(#spawnPositions)]); spawnPlayer(player, x, y, (z+0.5), math.random(360), 73, 0, 0); setCameraTarget(player, player); fadeCamera(player, true); local 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); setAccountData(getPlayerAccount(player), "isDead", false); setElementData(player, "isDead", false); setElementData(player, "logedin", true); for _,v in ipairs(playerDataTable) do if (v[1] ~= "radiochannel" and v[1] ~= "gpschannel") then setElementData(player, v[1], v[2]); end end setElementData(player, "logedin", true); setTimer(checkBuggedAccont, (25*1000), 1, player); setElementData(player, "spawnedzombies", 0); end end addEventHandler("kilLDayZPlayer", root, function(killer, headshot, weapon) local account = getPlayerAccount(source); if not account then return; end triggerClientEvent(source, "onClientPlayerDeathInfo", source); killPed(source); triggerClientEvent(source, "hideInventoryManual", source); if not isElementInWater(source) then if (getElementData(source, "alivetime") > 5) then -- If alivetime is bigger than 5 mins, to avoid haveing too much corpses at spawn. local x,y,z = getElementPosition(source); if (getDistanceBetweenPoints3D(x, y, z, 6000, 6000, 0) > 200) then local x,y,z = getElementPosition(source); local _,_,rotz = getElementRotation(source); local skin = getElementModel(source); local ped = createPed(skin, x, y, z, rotz); local pedCol = createColSphere(x, y, z, 1.5); killPed(ped); setTimer(function(ped, pedCol) if ped then destroyElement(ped); end if pedCol then destroyElement(pedCol); end end, (10*60000), 1, ped, pedCol); attachElements(pedCol, ped, 0, 0, 0); setElementData(pedCol, "parent", ped); setElementData(pedCol, "playername", getPlayerName(source)); setElementData(pedCol, "deadman", true); setElementData(pedCol, "MAX_Slots", getElementData(source, "MAX_Slots")); local time = getRealTime(); setElementData(pedCol, "deadreason", getPlayerName(source).." is dead. Cause of death: "..(weapon or "Unknown")..". Time of death: "..time.hour..":"..time.minute.." o'clock."); if pedCol then for _,v in ipairs(playerDataTable) do local itemPlus = getElementData(source, v[1]); if (v[1] == "M1911 Mag") then itemPlus = math.floor(getElementData(source, v[1])/10); elseif (v[1] == "M9 SD Mag") then itemPlus = math.floor(getElementData(source, v[1])/15); elseif (v[1] == "Desert Eagle Mag") then itemPlus = math.floor(getElementData(source, v[1])/7); elseif (v[1] == "PDW Mag") then itemPlus = math.floor(getElementData(source, v[1])/30); elseif (v[1] == "MP5A5 Mag") then itemPlus = math.floor(getElementData(source, v[1])/20); elseif (v[1] == "AS50 Mag") then itemPlus = math.floor(getElementData(source, v[1])/40); elseif (v[1] == "CZ550 Mag") then itemPlus = math.floor(getElementData(source, v[1])/10); elseif (v[1] == "Mosin 9130 Mag") then itemPlus = math.floor(getElementData(source, v[1])/35); elseif (v[1] == "M24 Mag") then itemPlus = math.floor(getElementData(source, v[1])/10); elseif (v[1] == "KVSK Mag") then itemPlus = math.floor(getElementData(source, v[1])/15); elseif (v[1] == "M107 Mag") then itemPlus = math.floor(getElementData(source, v[1])/5); elseif (v[1] == "SVD Dragunov Camo Mag") then itemPlus = math.floor(getElementData(source, v[1])/25); elseif (v[1] == "MK 48 Mod 0 Mag") then itemPlus = math.floor(getElementData(source, v[1])/100); elseif (v[1] == "MG36 Mag") then itemPlus = math.floor(getElementData(source, v[1])/100); elseif (v[1] == "PKP Mag") then itemPlus = math.floor(getElementData(source, v[1])/100); elseif (v[1] == "AK-107 Mag") then itemPlus = math.floor(getElementData(source, v[1])/30); elseif (v[1] == "AKS Gold Mag") then itemPlus = math.floor(getElementData(source, v[1])/30); elseif (v[1] == "SA-58V ACOG Mag") then itemPlus = math.floor(getElementData(source, v[1])/30); elseif (v[1] == "AKS-74U Mag") then itemPlus = math.floor(getElementData(source, v[1])/30); elseif (v[1] == "M4A1 Holo Mag") then itemPlus = math.floor(getElementData(source, v[1])/20); elseif (v[1] == "1866 Slug") then itemPlus = math.floor(getElementData(source, v[1])/7); elseif (v[1] == "2Rnd. Slug") then itemPlus = math.floor(getElementData(source, v[1])/2); elseif (v[1] == "SPAZ-12 Pellet") then itemPlus = math.floor(getElementData(source, v[1])/7); elseif (v[1] == "DMR Mag") then itemPlus = math.floor(getElementData(source, v[1])/5); elseif (v[1] == "SKS-45 Mag") then itemPlus = math.floor(getElementData(source, v[1])/10); end if not string.find(v[1], "(Equipped)") then setElementData(pedCol, v[1], itemPlus); end for i = 1, 3 do local item = getElementData(source, "currentweapon_"..tostring(i)); if (item ~= "") then setElementData(pedCol, item, 1); end end end local skin = getSkinNameFromID(getElementData(source, "skin")); setElementData(pedCol, skin, getElementData(pedCol, skin) + 1); local backpack = getBackpackNameFromSlots(getElementData(source, "MAX_Slots")); setElementData(pedCol, backpack, (getElementData(pedCol, backpack) or 0) + 1); end end end end if (killer and killer ~= source and getElementType(killer) == "player") then if (getElementData(source, "htype") ~= "Bandit") then addPlayerStats(killer, "humanity", math.random(-2500, -1000)); else addPlayerStats(killer, "humanity", math.random(1000, 2500)); end setElementData(killer, "murders", getElementData(killer, "murders") + 1); if (getElementData(source, "htype") == "Bandit") then setElementData(killer, "banditskilled", getElementData(killer, "banditskilled") + 1); end if headshot then setElementData(killer, "headshots", getElementData(killer, "headshots") + 1); end triggerClientEvent("displayClientInfo", root, "#FFFFFF"..getPlayerName(source).." #FFFFFFwas killed by "..getPlayerName(killer), 0, 22, 255); else triggerClientEvent("displayClientInfo", root, "#FFFFFF"..getPlayerName(source).." #FFFFFFwas killed", 0, 22, 255); end setTimer(setElementPosition, 500, 1, source, 6000, 6000, 0); setAccountData(account, "isDead", true); setElementData(source, "isDead", true); setTimer(spawnDayZPlayer, 10000, 1, source); end); addEventHandler("onPlayerQuit", root, function() savePlayerData(source); end); addEventHandler("onResourceStop", root, function() for _,v in pairs(getElementsByType("player")) do savePlayerData(v); end end); [2019-10-30 18:32:05] ERROR: [DayZ-MTA]/DayZ/accounts.Lua:344: attempt to perform arithmetic on a boolean value [2019-10-30 18:32:06] WARNING: [DayZ-MTA]/DayZ/accounts.Lua:344: Bad argument @ 'getElementData' [Expected string at argument 2, got nil] [2019-10-30 18:32:06] ERROR: [DayZ-MTA]/DayZ/accounts.Lua:344: attempt to perform arithmetic on a boolean value [2019-10-30 18:31:02] ERROR: [DayZ-MTA]/DayZ/accounts.Lua:307: attempt to perform arithmetic on a boolean value [2019-10-30 18:31:08] WARNING: [DayZ-MTA]/DayZ/accounts.Lua:307: Bad argument @ 'getElementData' [Expected string at argument 2, got nil] [2019-10-30 18:31:08] ERROR: [DayZ-MTA]/DayZ/accounts.Lua:307: attempt to perform arithmetic on a boolean value https://imgur.com/a/rRBCOHf when I give /kill it kills me and my screen floats and does not respawn me
  9. Hi all ! I found the problem so it does not spawn me and just shows me the interface from the 51st! I don't know if this function works correctly! Maybe someone can help me figure it out! addEvent("onPlayerDayZRegister", true); addEvent("onPlayerDayZLogin", true); addEvent("kilLDayZPlayer", true); addEventHandler("onPlayerDayZLogin", root, function(player) local account = getPlayerAccount(player); local x,y,z = getAccountData(account, "last_x"), getAccountData(account, "last_y"), getAccountData(account, "last_z"); local skin = getAccountData(account, "skin"); if getAccountData(account, "isDead") then return spawnDayZPlayer(player); end spawnPlayer(player, x, y, (z+2), math.random(360), skin, 0, 0); fadeCamera(player, true); setCameraTarget(player, player); local 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 _,v in ipairs(playerDataTable) do setElementData(player, v[1], getAccountData(account, v[1])); end setElementData(player, "logedin", true); setElementModel(player, getElementData(player, "skin")); setTimer(checkBuggedAccont, (25*1000), 1, player); setElementData(player, "spawnedzombies", 0); equipThem(player, 0); end); addEventHandler("onPlayerDayZRegister", getRootElement(), function(player) spawnDayZPlayer(player); setElementData(player, "radiochannel", "99999"); setElementData(player, "gpschannel", ""); setElementData(player, "gang", "None"); savePlayerData(player); end); function spawnDayZPlayer(player) if player then local x,y,z = unpack(spawnPositions[math.random(#spawnPositions)]); spawnPlayer(player, x, y, (z+0.5), math.random(360), 73, 0, 0); setCameraTarget(player, player); fadeCamera(player, true); local 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); setAccountData(getPlayerAccount(player), "isDead", false); setElementData(player, "isDead", false); setElementData(player, "logedin", true); for _,v in ipairs(playerDataTable) do if (v[1] ~= "radiochannel" and v[1] ~= "gpschannel") then setElementData(player, v[1], v[2]); end end setElementData(player, "logedin", true); setTimer(checkBuggedAccont, (25*1000), 1, player); setElementData(player, "spawnedzombies", 0); end end
  10. in /debugscript 3 I show no error everything is clean neither warnings nor errors ! look does not show me any error or warning, only the admin appears and so much! https://imgur.com/a/daD2ISn
  11. I did as you said, but another problem appeared to me! That's when I logged on to the server! Here's a picture: https://imgur.com/a/oAJvIYZ
  12. What ?! im need function for repairing problem ?!!!
  13. Hi all ! I have a problem !?! I have a DayZ MTA server and when I log in I randomly teleport and spam me with Account has been reset! I use the MTA DayZ 0.7r3 gamemode ! can i change this script with another one? that when I go to another login panel I get a black screen! look here for some pictures that randomly spawn me and spam me at Account is Buggy has been reset! Photos: https://imgur.com/a/hEfCFXa please help me well i am a beginner in scripting and i need help !!! (Don't hate that you were like me too and you were scripting and asking for help) function checkBuggedAccont(player) if isElement(player) then if not isGuestAccount(getPlayerAccount(player)) then if getElementData(player, "logedin") then if (getElementModel(player) == 0) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); return; end for _,v in ipairs(playerDataTable) do if (type(getElementData(player, v[1])) ~= type(v[2])) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); end end end end end end addCommandHandler("kill", function(player) triggerEvent("kilLDayZPlayer", player); end);
  14. Hi all ! I downloaded the gamemode MTA: DayZ 0.7r6 and put some cars on it and when I want to spawn a patriot or other vehicle I no longer see the top hud with engine pulls and parts! Can anyone help me with this problem please! Look here the files maybe I did something wrong! http://www.fileshare.ro/e3427091278 http://www.fileshare.ro/e3427091280 If you read this message it means that you are a good person who can help me with this problem! Thank you in advance !