Jump to content

dima3367

Members
  • Posts

    67
  • Joined

  • Last visited

About dima3367

  • Birthday 19/08/1994

Recent Profile Visitors

1,008 profile views

dima3367's Achievements

Snitch

Snitch (10/54)

1

Reputation

  1. Hi all, tell me why I insert a function for that would not work when entering text binds, but they still work. Here's a piece of code. local window = guiCreateWindow(0.36,0.2, 0.3,0.35, '', true) guiSetVisible(window,false) guiWindowSetSizable(window,false) local grid = guiCreateGridList(0,0.1, 0.6,1, true, window) local column = guiGridListAddColumn(grid, 'Никнейм', 0.9) guiCreateLabel(0.685,0.1, 1,0.1, 'Поиск по нику:',true,window) local edit_nickname = guiCreateEdit(0.63,0.17, 1,0.1, '',true,window) guiSetInputMode("no_binds_when_editing") guiCreateLabel(0.685,0.3, 1, 0.1, 'Срок (в минутах):', true, window) local edit = guiCreateEdit(0.63,0.37, 1,0.1, '', true,window) local button = guiCreateButton(0.63,0.48, 1,0.1, 'Посадить',true,window) addEventHandler('onClientGUIClick',button,function() if source ~= button then return end local detention = tonumber(guiGetText(edit)) if not detention then return end local nick = guiGridListGetSelectedText(grid,1) triggerServerEvent('server:arrest',localPlayer,nick,detention) end)
  2. Hello everybody! Please tell me how to make the team work through the server console? I need to make the /givemoney team work through the server console . I made an export to meta to the function where the command is written, but this did not help. I would be grateful for your help.
  3. Hi all! Tell me how to do or maybe someone has a script to restart the server at a certain time? That is, I need to have the server restart automatically at a certain time once a day, for example at 5.00 am. I would really appreciate your help.
  4. Hello! You have a problem that when typing a message in chat when a player is in the car, it switches to the camera when you press V, how to make so that when typing in chat, no binds not activated?
  5. Hello! I have a resource responsible for the teleportation of the player to his garage where he gets to choose his car. But there is a small bug that appears very rarely, but nevertheless it appears the players, namely that of the player after entering the garage and exiting beams are not the same direction from which he came, and under the texture in the field. It is accompanied by this error: Here is the send part of the code, tell me, what could be and how to fix it, I would be very grateful. addEvent("tws-serverGarageEnter", true) addEvent("tws-serverGarageExit", true) addEventHandler("tws-serverGarageEnter", resourceRoot, function(garagePosition) local playerAccount = getPlayerAccount(client) if isGuestAccount(playerAccount) then triggerClientEvent(player, "tws-clientGarageEnter", resourceRoot, false, "Вы не залогинены") return end -- Массив машин игрока local playerVehiclesJSON = getAccountData(playerAccount, "vehicles") if not playerVehiclesJSON then triggerClientEvent(player, "tws-clientGarageEnter", resourceRoot, false, "Не удалось получить список ваших автомобилей") return end -- Координаты игрока перед входом в гараж local garageEnterInfo = { position = client.position, rotation = client.rotation } local vehicleToShow = 1 if isElement(client.vehicle) then -- Если игрок в машине, запоминаем координаты машины garageEnterInfo.position = client.vehicle.position garageEnterInfo.rotation = client.vehicle.rotation -- Если игрок в машине, принадлежащей ему, отправляем её в гараж if exports["tws-vehicles"]:isVehicleOwnedByPlayer(client.vehicle, client) then vehicleToShow = exports["tws-vehicles"]:getVehicleGarageID(client.vehicle) exports["tws-vehicles"]:returnVehicleToGarage(client.vehicle) removePedFromVehicle(client) end end local playerVehiclesTable = fromJSON(playerVehiclesJSON) if playerVehiclesTable then local spawnedVehicles = exports["tws-vehicles"]:getPlayerSpawnedVehicles(client) for k,v in pairs(spawnedVehicles) do playerVehiclesTable[k].spawned = true end else triggerClientEvent(player, "tws-clientGarageEnter", resourceRoot, false, "Ошибка получения списка ваших автомобилей") return end -- Кладём координаты в дату client:setData("tws-garageEnterInfo", garageEnterInfo) client:setData("tws-inGarage", true) client.interior = 0 client.dimension = exports["tws-main"]:getPlayerID(client) client:setPosition(unpack(garagePosition)) client.position = client.position + Vector3(0, 0, 10) triggerClientEvent(client, "tws-clientGarageEnter", resourceRoot, true, toJSON(playerVehiclesTable), vehicleToShow) end ) addEventHandler("tws-serverGarageExit", resourceRoot, function(selectedVehicleID) if client:getData("tws-inGarage") == false then return end client:setData("tws-inGarage", false) client.dimension = 0 client.interior = 0 if selectedVehicleID then local vehicle = exports["tws-vehicles"]:spawnPlayerVehicle(client, selectedVehicleID, 0, 0, 0) removePedFromVehicle(client) warpPedIntoVehicle(client, vehicle) setCameraTarget(client) end local garageEnterInfo = client:getData("tws-garageEnterInfo") if not garageEnterInfo then garageEnterInfo = {position: Vector3(0, 0, 0), rotation: Vector3(0, 0, 0)} end if isElement(client.vehicle) then client.vehicle.position = garageEnterInfo.position client.vehicle.position = garageEnterInfo.position else client.position = garageEnterInfo.position client.position = garageEnterInfo.position end triggerClientEvent(client, "tws-clientGarageExit", resourceRoot) end )
  6. There is here such request: <export function="getPlayerMoney" type="server"/> But he server, and the code snippet I sent above, client. How to be?
  7. Hello! I have such a problem, it's impossible to check the player's money. I have a game mod that uses its own money system. And for example, that the player would give the money to the resource, I have to use the export. Example: exports["tws-main"]:givePlayerMoney I need to do something by analogy to check the player's amount of money. For example, in this function: function StartStudyBtn () if source == StartLessonBtn then local playerLesson = guiGridListGetItemData ( VehicleLessons, guiGridListGetSelectedItem ( VehicleLessons ), 2 ) local Money = guiGridListGetItemText ( VehicleLessons, guiGridListGetSelectedItem ( VehicleLessons ), 3 ) local StudyLevel = getElementData(localPlayer, "VehLevel")+1 if playerLesson and guiGetEnabled(StartLessonBtn) == true then if getPlayerMoney () < tonumber(Money) then outputChatBox("У вас недостаточно денег") else if tonumber(playerLesson) > tonumber(StudyLevel) then outputChatBox("Вы не прошли предыдуший курс") elseif tonumber(playerLesson) < tonumber(StudyLevel) then outputChatBox("Вы уже прошли этот курс") else if (getElementData ( localPlayer, "working") == "1") then setElementModel ( localPlayer, tonumber(getElementData ( localPlayer, "skinback"))) setElementData ( localPlayer, "working", "0" ) end guiSetVisible(LicensePanel,false) showCursor(false) removeEventHandler ( "onClientGUIClick", getRootElement(), ByLicense ,false ) removeEventHandler ( "onClientGUIClick", getRootElement(), StartStudyBtn ,false ) triggerServerEvent("TakePlayerMoney", getRootElement(), localPlayer,Money) setLesson(playerLesson) end end end end end In line 7 there is a check whether the player has enough money. I need to make an appeal to my system of money tws-money. I tried to do so: if localPlayer:getData("tws-money") < tonumber(Money) then But I get an error. How can I do this here? Please tell me. I apologize for the bad english.
  8. The topic is still relevant. Who can help?
  9. Hello everybody! Just sorry for bad english. Such a problem on my server for some reason the player appears on the mini map on the floor or the entire screen. I tried to replace the mini card script, but the problem has not disappeared from this, only some players. And that's exactly what the image is spreading from the border with the minimap. What could be and how it is possible to fix? Here is a screenshot of the problem Advance would be very grateful for the answer!
  10. Hello is it possible to make a resource that would be replaced by a player animation? That is, when loading the resources on the server it has replaced the file in the folder with GTA Sa ped.ifp?
  11. I can not understand it because it shows that the player himself would be included.
  12. Please tell me how to use this setPedCanBeKnockedOffBike to do so would be a player did not fall with the default motorcycle. Not much I can understand that some who are not hard to please.
  13. Hello. Tell me, how can I do so that would be dropped if the player in the car into the water, the oxygen and the life he had not taken away?
  14. Not much I can understand how it can be implemented immediately. This is the server part of the script: createBlip(1904.80798, -1875.38660, 13.56194,46) local sweeperki = { {1904.80798, -1875.38660, 13.56194, 270}, {1904.80798, -1870.38660, 13.56194, 270}, {1904.80798, -1865.38660, 13.56194, 270}, {1904.80798, -1860.38660, 13.56194, 270}, {1904.80798, -1855.38660, 13.56194, 270}, {1904.80798, -1850.38660, 13.56194, 270}, {1917.8698, -1862.37256 , 13.56194, 90}, {1921.8698, -1862.37256 , 13.56194, 90}, {1925.8698, -1862.37256 , 13.56194, 90}, } for i,v in ipairs(sweeperki) do v.sweeper = createVehicle(574, v[1], v[2], v[3], 0, 0, v[4]) setElementData(v.sweeper, "sweeper:dopracy", 1) setElementFrozen(v.sweeper, true) setVehicleLocked(v.sweeper, false) setVehicleDamageProof(v.sweeper, true ) end local punkty = { [1] = {1954.08594, -1874.65625, 13.54688}, [2] = {1954.26794, -1886.18250, 13.54688}, [3] = {1954.13489, -1897.88843, 13.54688}, [4] = {1954.27319, -1909.31433, 13.54688}, [5] = {1951.84375, -1924.82556, 13.54688}, [6] = {1941.38416, -1924.69043, 13.54688}, [7] = {1926.11865, -1924.13684, 13.54688}, [8] = {1911.16296, -1924.30396, 13.54688}, [9] = {1896.21094, -1924.20935, 13.54688}, [10] = {1873.53076, -1924.54944, 13.54688}, [11] = {1858.87756, -1924.69458, 13.54688}, [12] = {1848.70020, -1924.64734, 13.54688}, [13] = {1833.95801, -1924.28638, 13.54688}, [14] = {1829.27258, -1920.93982, 13.54875}, [15] = {1829.00964, -1908.74426, 13.51301}, [16] = {1829.18213, -1898.01489, 13.47368}, [17] = {1829.21655, -1887.19006, 13.47277}, [18] = {1829.34045, -1855.69873, 13.57813}, [19] = {1829.15881, -1835.55383, 13.77813}, [20] = {1829.06641, -1817.33350, 13.57336}, [21] = {1828.96204, -1800.64502, 13.55298}, [22] = {1829.54895, -1787.36963, 13.54688}, [23] = {1829.43481, -1773.53503, 13.54688}, [24] = {1833.90747, -1760.08167, 13.54688}, [25] = {1845.34924, -1760.04407, 13.54688}, [26] = {1860.09766, -1759.97449, 13.54688}, [27] = {1870.29443, -1759.97632, 13.54688}, [28] = {1889.15906, -1759.92346, 13.54688}, [29] = {1922.46289, -1759.83020, 13.54688}, [30] = {1953.61145, -1771.04236, 13.54688}, [31] = {1953.99561, -1807.84521, 13.54688}, [32] = {1954.12012, -1817.94287, 13.54688}, [33] = {1954.80115, -1837.05542, 13.53908}, [34] = {1954.49500, -1856.19482, 13.54688} } function nextPunkt(plr, id) local x,y,z = punkty[id][1], punkty[id][2], punkty[id][3] triggerClientEvent(plr, "postawSweeperMarker", plr, x, y, z) end function startSweeperki(veh, seat) if getElementData(veh, "sweeper:dopracy") == 1 and seat == 0 then outputChatBox("Диспетчер Анна: Добро пожаловать на работу уборщика улиц.", source) outputChatBox("Диспетчер Анна: Продолжайте движение по синим маркерам!", source) outputChatBox("Диспетчер Анна: За каждый круг тебе заплатят 500$", source) nextPunkt(source, 1) setElementFrozen(veh, false) setVehicleLocked(veh, true) setVehicleDamageProof(veh, true ) setElementData(source, "sweeper:smiec", 1) setElementData(source, "sweeper:zebrane", 0) if veh then fixVehicle(veh) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), startSweeperki) function stopSweeperki(veh, seat) if getElementData(veh, "sweeper:dopracy") == 1 and seat == 0 then respawnVehicle(veh) setElementFrozen(veh, true) setVehicleLocked(veh, false) setVehicleDamageProof(veh, true ) triggerClientEvent(source, "usunSweeperMarker", source) end end addEventHandler("onPlayerVehicleExit", getRootElement(), stopSweeperki) function serverSweeperHit(plr) if (getElementData(plr, "sweeper:smiec")+1) == #punkty then setElementData(plr, "sweeper:smiec", 1) nextPunkt(plr, 1) exports["tws-main"]:givePlayerMoney(plr, 500) outputChatBox("Диспетчер Анна: Вы получили 500$, можете продолжить или закончить, оставив машину.", source) else setElementData(plr, "sweeper:smiec", getElementData(plr, "sweeper:smiec")+1) nextPunkt(plr, getElementData(plr, "sweeper:smiec")) end end addEvent("sweeperkiHitFunction", true) addEventHandler("sweeperkiHitFunction", getRootElement(), serverSweeperHit) Could you show an example?
  15. Hello, please tell me, how do I do so that the players could not in any way to open the doors for players to drgua car. My script works works as a player gets in the car, then I used the function: bool setVehicleLocked ( vehicle theVehicle, bool locked ) The doors are closed and it is impossible to sit down. But there is a bug, if the player in advance would open the door and quickly gone, the door will be shown as open. The player sits in the car through the other (closed) door, the machine once again uses setVehicleLocked However, another player can steal a car if he sits through the door, which was opened in advance. Meanwhile sama he could steal his car. How can I fix it? I apologize in advance for the bad english.
×
×
  • Create New...