Jump to content

Seba500PLK

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by Seba500PLK

  1. ok, no i change on command function createKillPed(player) local x, y, z = getElementPosition(player) local rotX, rotY, rotZ = getElementRotation(player) local skin = getElementModel(player) local ped = createPed(0, x, y, z, rotZ) pedCol = createColSphere(x, y, z, 1.5) killPed(ped) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", getPlayerName(player)) setElementData(pedCol, "dead", true) end addCommandHandler("ded",createKillPed) ped is creating. I no get ped name
  2. 0.o [23:13:41] WARNING: Skrypt\s.lua:3: Bad argument @ 'getElementPosition' [Expected element at argument 1, got nil] [23:13:41] WARNING: Skrypt\s.lua:4: Bad argument @ 'getElementRotation' [Expected element at argument 1, got nil] [23:13:41] WARNING: Skrypt\s.lua:5: Bad argument @ 'getElementModel' [Expected element at argument 1, got nil] [23:13:41] WARNING: Skrypt\s.lua:6: Bad argument @ 'createPed' [Expected vector3 at argument 2, got boolean] [23:13:41] WARNING: Skrypt\s.lua:7: Bad argument @ 'createColSphere' [Expected vector3 at argument 1, got boolean] [23:13:41] WARNING: Skrypt\s.lua:8: Bad argument @ 'killPed' [Expected element at argument 1, got boolean] [23:13:41] WARNING: Skrypt\s.lua:9: Bad argument @ 'attachElements' [Expected element at argument 1, got boolean] [23:13:41] WARNING: Skrypt\s.lua:10: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [23:13:41] WARNING: Skrypt\s.lua:11: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil] [23:13:41] WARNING: Skrypt\s.lua:11: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [23:13:41] WARNING: Skrypt\s.lua:12: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]
  3. console no Debugscript one moment
  4. Hi, my problem is ped function createKillPed() local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) local skin = getElementModel(source) local ped = createPed(0, x, y, z, rotZ) pedCol = createColSphere(x, y, z, 1.5) killPed(ped) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", getPlayerName(source)) setElementData(pedCol, "dead", true) end function GetDeadName() for i, ped in ipairs(getElementsByType("ped")) do if getElementData(ped, "dead") then local name = getElementData(ped, "playername") outputChatBox(name) end end addCommandHandler("getdeadname",GetDeadName) in console anyone errors
  5. CLIENT Show anyone. work when I delete guiGridListRemoveRow function show() local x, y = guiGetScreenSize() window = guiCreateWindow(x / 2 - 310, y / 2 - 260, 620, 520, "Panel Admina", false) guiWindowSetSizable ( window, false ) guiSetVisible(window,false) TabPanel = guiCreateTabPanel ( 0.01, 0.05, 0.98, 0.95, true, window ) test= guiCreateGridList ( 0.53, 0.10, 0.30, 0.83, true, window ) local columnV = guiGridListAddColumn( test, "Test", 0.5 ) buttonRefV = guiCreateButton(466, 263, 92, 17, "Refresh", false, aTab1.Tab) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), function () if (source == buttonRefV) then local rowV2 = guiGridListAddRow ( test) guiGridListRemoveRow(test, rowV2) guiGridListSetItemText ( test, rowV2, columnV, "5", false, false ) end end) end
  6. function openGui() local x, y = guiGetScreenSize() window = guiCreateWindow(x / 2 - 310, y / 2 - 260, 620, 520, "Panel Admina", false) guiWindowSetSizable ( window , false ) guiSetVisible(window ,false) TabPanel = guiCreateTabPanel ( 0.01, 0.05, 0.98, 0.95, true, window ) aTab1 = {} aTab1.Tab = guiCreateTab ( "Players", TabPanel, "players" ) aTab1.PlayerList = guiCreateGridList ( 0.03, 0.10, 0.20, 0.83, true, aTab1.Tab ) local column = guiGridListAddColumn( aTab1.PlayerList, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( aTab1.PlayerList ) guiGridListSetItemText ( aTab1.PlayerList, row, column, getPlayerName ( player ), false, false ) end end aTab1.IP = guiCreateLabel ( 0.26, 0.13, 0.30, 0.035, "IP: ", true, aTab1.Tab ) buttonSel = guiCreateButton(416, 263, 92, 17, "Select", false, aTab1.Tab) end function ButtonSel(button, state, absoluteX, absoluteY,player,ip) if (source == button) then guiSetText ( aTab1.Name, "IP: "..ip) triggerServerEvent('event1',localPlayer,guiGridListGetItemText ( aTab1.PlayerList, guiGridListGetSelectedItem ( aTab1.PlayerList ), column ),localPlayer) end end addEvent( "ToClient", true ) addEventHandler( "ToClient", localPlayer, ButtonSel) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()),ButtonSel)
  7. Hi, i cant get ip address CLIENT: function ButtonSel(button, state, absoluteX, absoluteY,player,ip) if (source == button) then guiSetText ( aTab1.Name, "IP: "..ip) triggerServerEvent('event1',localPlayer,guiGridListGetItemText ( aTab1.PlayerList, guiGridListGetSelectedItem ( aTab1.PlayerList ), column ),localPlayer) end end addEvent( "ToClient", true ) addEventHandler( "ToClient", localPlayer, ButtonWybierz ) addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()),ButtonWybierz) SERVER: addEvent('event1',true) addEventHandler('event1',root, function(event1, player) triggerClientEvent ( player, "ToClient",player, getPlayerIP(player) ) end )
  8. 0.oI mean that when this will occur 24 hours a feed added one day, and that mattered again
  9. Hello, my problem is that such shows. 02:60:59. Minutes and days shows correctly. Hour is displayed wrong. function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function formatTimeFromMinutes(value) if value then local weekday = math.floor(value / 1440) local hours = math.floor(value / 60) local minutes = math.round((value / 60 - math.floor(value / 60)) * 100 / 1.6666666666666667) if weekday < 10 then weekday = "0" .. weekday end if hours < 10 then hours = "0" .. hours end if minutes < 10 then minutes = "0" .. minutes end value = weekday.. ":" ..hours .. ":" .. minutes return value end return false end function displaytime() local alivetime = getElementData(getLocalPlayer(), "alivetime") outputChatBox(formatTimeFromMinutes(alivetime)) end ElementData "alivetime" +1 is added every 1 minute
  10. Hello, I have a problem with the ID of the object when you want the object to delete it I can not retrieve the ID -----m_s.lua------- function RemoveObject(object) local x, y, z = getElementPosition(getElementData(object, "parent")) destroyElement(getElementData(object, "parent")) destroyElement(object) local nid = getElementData(getElementData(object, "parent"),"nid") outputChatBox (nid) --local d = dbQuery ( dbConnection, "DELETE FROM Objects WHERE id='"..nid.."'" ) --dbFree ( d ) end addEvent("removeObject", true) addEventHandler("removeObject", getRootElement(), RemoveObject) Trigger Event "RemoveObject": if itemName == "Case" then local col = getElementData(getLocalPlayer(), "currentCol") triggerServerEvent("removeObject", getLocalPlayer(), getElementData(col, "parent")) disableMenu() return end error in console: [16:31:29] WARNING: [scripts]/Testing/m_s.lua:10: Bad argument @ 'getElementData ' [Expected element at argument 1] [16:31:29] WARNING: [scripts]/Testing/m_s.lua:10: Bad argument @ 'getElementData ' [Expected element at argument 1, got boolean] [16:31:29] WARNING: [scripts]/Testing/m_s.lua:12: Bad argument @ 'outputChatBox' [Expected string at argument 1, got boolean]
  11. I know what is happening. The script saves the vehicle but saves them as many times as vehicles on the server function SaveVehicles() local sql = dbQuery(dbConnection,"SELECT * FROM Pojazdy") local rezultat,num_rows = dbPoll ( sql, - 1 ) if sql then if rezultat then for _, row in ipairs ( rezultat ) do for i, vehicle in ipairs (getElementsByType("vehicle")) do local x, y, z = getElementPosition(vehicle) local rx, ry, rz = getElementRotation(vehicle) local color1, color2, color3, color4 = getVehicleColor(vehicle) local model = getElementModel(vehicle) --local vid = getElementData(vehicle, "VehicleID") local health = getElementHealth (vehicle) local tableUpgrades = getVehicleUpgrades(vehicle) local upgrades = table.concat(tableUpgrades, ",") local paintjob = getVehiclePaintjob(vehicle) outputChatBox("* save id: "..row.id..", Model: "..model, source) dbExec (dbConnection, "UPDATE Pojazdy SET Model='" .. model .. "', LastPosX='" .. x .. "', LastPosY='" .. y .. "',LastPosZ='" .. z .. "',LastRotX='" .. rx .. "',LastRotY='" .. ry .. "',LastRotZ='" .. rz .. "' WHERE id='"..row.id.."'") end end end end end addCommandHandler ( "sv", SaveVehicles ) when you type the command / sv appear vehicles saved:
  12. Unfortunately, I have another question, this time saveing vehicles. function SaveVehicles() for i, vehicle in pairs (getElementsByType("vehicle")) do local x, y, z = getElementPosition(vehicle) local rx, ry, rz = getElementRotation(vehicle) local color1, color2, color3, color4 = getVehicleColor(vehicle) local model = getElementModel(vehicle) local health = getElementHealth (vehicle) local tableUpgrades = getVehicleUpgrades(vehicle) local upgrades = table.concat(tableUpgrades, ",") local paintjob = getVehiclePaintjob(vehicle) dbExec (dbConnection, "UPDATE Pojazdy SET Vehicle_ID='" .. model .. "', LastPosX='" .. x .. "', LastPosY='" .. y .. "',LastPosZ='" .. z .. "',LastRotX='" .. rx .. "',LastRotY='" .. ry .. "',LastRotZ='" .. rz .. "'") end end addCommandHandler ( "sv", SaveVehicles ) MySQL: Before save: AFTER save:
  13. Hello, I made such a code, but when the vehicle load is shown only one function LoadVehicles() local sql = dbQuery(dbConnection,"SELECT * FROM Pojazdy") local rezultat,num_rows = dbPoll ( sql, - 1 ) if sql then if rezultat then local VehicleID = v.rezultat[1].Vehicle_ID local x = rezultat[1].LastPosX local y = rezultat[1].LastPosY local z = rezultat[1].LastPosZ local rx = rezultat[1].LastRotX local ry = rezultat[1].LastRotY local rz = rezultat[1].LastRotZ veh = createVehicle(VehicleID, x, y, z, rx, ry, rz) end end end addCommandHandler ( "lv", LoadVehicles )
  14. What?? if I give the positions of the vehicle it works local x, y, z = getElementPosition(col, theVehicle) <Pojazd posX="-92.9951171875" posY="2823.0908203125" posZ="76.721649169922" rotX="false" rotY="nil" rotZ="nil"></Pojazd> <Pojazd posX="-2448.99609375" posY="-1335.8662109375" posZ="310.97662353516" rotX="false" rotY="nil" rotZ="nil"></Pojazd> <Pojazd posX="-173.2470703125" posY="-2635.5341796875" posZ="26.608192443848" rotX="false" rotY="nil" rotZ="nil"></Pojazd>
  15. This is a script to save all the vehicles on the map, using the command
  16. If the insertion is: local rx, ry, rz = getElementRotation(theVehicle) <Pojazd rotX="0" rotY="0" rotZ="119.59625244141"></Pojazd> <Pojazd rotX="0" rotY="0" rotZ="119.59625244141"></Pojazd> <Pojazd rotX="0" rotY="0" rotZ="119.59625244141"></Pojazd> <Pojazd rotX="0" rotY="0" rotZ="119.59625244141"></Pojazd> Rotation is the same for all vehicle
×
×
  • Create New...