-
Posts
373 -
Joined
-
Last visited
-
Days Won
12
Everything posted by Hydra
-
Client: bindKey("e", "down", function() local getJob = getElementData(localPlayer, "Jobs") or "NONE" if getJob == "Dealer" then if not isElementWithinColShape(localPlayer, Col) then return outputChatBox("You must be inside the farming zone", 255, 255, 255, true) end if not exports.global:hasItem(localPlayer, 285) then return end if TSK == false then return end TSK = false setPedAnimation(localPlayer, "BOMBER", "BOM_Plant", -1, false, false, false, false) triggerServerEvent("TakeSeedfromPlayer", localPlayer) setTimer(function() local x, y, z = getElementPosition(localPlayer) local Object = createObject(677, x, y, z - 1) outputChatBox("You planted seed", 255, 255, 255, true) TSK = true setTimer(function() if isElement(Object) then destroyElement(Object) triggerServerEvent("GiveDrugtoPlayer", localPlayer) end end, 6000, 1) end, 2000, 1) end end) Server: addEvent("TakeSeedfromPlayer", true) addEventHandler("TakeSeedfromPlayer", root, function(takeseed) if exports.global:hasItem(source, 285) then exports.global:takeItem(source, 285) else outputChatBox("#ffffff[ #FC861DDrug-System#ffffff ] : You don't have enough seeds.",source,255, 255, 255,true) end end) The problem was solved on discord, so I think this topic can be closed
-
First of all, Do not post 3 topics about the same problem. Post one topic about your issues and wait for someone to help you
-
Some new clips: New Lighting System https://streamable.com/wc8yo2 Radio System: https://cdn.discordapp.com/attachments/1153391111717539860/1157709179734208522/projectv-radiosystem.mp4?ex=651b9271&is=651a40f1&hm=0c6e6a044e1250978f0316ea35a76ed7418370f83b752805a08c6fd55f9be1cc&
- 1 reply
-
- 1
-
-
Shouldn't it be? if key == "lctrl" and key == "mouse1" then cancelEvent() end
-
There is nothing wrong in meta, you can put type for <file src> too
-
If you don't hear the sound, try to look for one for about 2-3 seconds maximum and in playSound("beep.mp3", false) put playSound("beep.mp3", true) so that the sound repeats. if this don't work idk then
-
There are a lot of problems with your script Try this: local alarm = nil bindKey("s", "down", function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then if isVehicleReversing(vehicle) then local nearObject = getNearestElement(vehicle, "object", 15) if nearObject then if alarm == nil then alarm = playSound("beep.mp3", false) end end end end end) function ForceSoundOff() local vehicle = getPedOccupiedVehicle(localPlayer) if not isVehicleReversing(vehicle) then if alarm ~= nil then stopSound(alarm) alarm = nil end end end addEventHandler("onClientRender", root, ForceSoundOff) function getNearestElement(player, type, distance) local result = false local dist = nil if player and isElement(player) then local elements = getElementsWithinRange(Vector3(getElementPosition(player)), distance, type, getElementInterior(player), getElementDimension(player)) for i = 1, #elements do local element = elements[i] if not dist then result = element dist = getDistanceBetweenPoints3D(Vector3(getElementPosition(player)), Vector3(getElementPosition(element))) else local newDist = getDistanceBetweenPoints3D(Vector3(getElementPosition(player)), Vector3(getElementPosition(element))) if newDist <= dist then result = element dist = newDist end end end end return result end function isVehicleReversing(theVehicle) local getMatrix = getElementMatrix (theVehicle) local getVelocity = Vector3 (getElementVelocity(theVehicle)) local getVectorDirection = (getVelocity.x * getMatrix[2][1]) + (getVelocity.y * getMatrix[2][2]) + (getVelocity.z * getMatrix[2][3]) if (getVectorDirection < 0) then return true end return false end
-
# Project:V Project:V is a server based on the game mode from GTA:V Online. We are trying to bring every feature from GTA:V to this server to create something unique and long lasting. The server is still in progress but quite a lot of progress has been made, I won't post every update here and I'll let you go to our discord server to see what the server looks like at the moment Some screens: https://streamable.com/ghma0r https://streamable.com/vdffx6 Discord: https://discord.gg/XcPJeahDQE
- 1 reply
-
- 3
-
-
-
function setCursorCenteredOnRectangle(x, y, width, height) if x and y and width and height then setCursorPosition(x + width/2, y + height/2) end end Cu aceasta functie puteti seta cursoru in centrul unui rectangle(merge si pentru text cel mai probabil) https://wiki.multitheftauto.com/wiki/SetCursorCenteredOnRectangle
-
1. Create a new .lua file 2. Open meta and type <script src="yourfile.lua" type="shared" /> It will look like this Shared File: my_var = "test" Server File: addCommandHandler("s", function(p, c) outputChatBox(my_var, root, 255, 255, 255, true) end) Client File: addCommandHandler("c", function() outputChatBox(my_var) end) I hope this is what you mean
-
you forgot to use addEvent for your function to work when you want to trigger it Client function onVehicleStuckInWater(vehicle) local delay = 4 -- in seconds timer.start(delay, function() destroyVehicle(vehicle) end) end addEvent("onVehicleStuckInWater", true) addEventHandler("onVehicleStuckInWater", root, onVehicleStuckInWater)
-
Weather & Time events --// Client addDebugHook("postFunction", function(_, _, _, _, _, weatherType) triggerEvent("onClientWeatherChange", resourceRoot, weatherType) end, {"setWeather"}) addDebugHook("postFunction", function(_, _, _, _, _, timeHour, timeMinute) triggerEvent("onClientTimeChange", resourceRoot, timeHour, timeMinute) end, {"setTime"}) --// Server addDebugHook("postFunction", function(_, _, _, _, _, weatherType) triggerEvent("onWeatherChange", resourceRoot, weatherType) end, {"setWeather"}) addDebugHook("postFunction", function(_, _, _, _, _, timeHour, timeMinute) triggerEvent("onTimeChange", resourceRoot, timeHour, timeMinute) end, {"setTime"}) EXAMPLES (CLIENT & SERVER): function TimeOnWeatherChange() outputChatBox("Weather changed (SERVER)", root, 255, 255, 0, true) end addEvent("onWeatherChange") addEventHandler("onWeatherChange", root, TimeOnWeatherChange) function TimeCheck() outputChatBox("Time changed (SERVER)", root, 255, 255, 0, true) end addEvent("onTimeChange") addEventHandler("onTimeChange", root, TimeCheck) function CTimeOnWeatherChange() outputChatBox("Weather changed (CLIENT)") end addEvent("onClientWeatherChange") addEventHandler("onClientWeatherChange", root, CTimeOnWeatherChange) function CTimeCheck() outputChatBox("Time changed (CLIENT)") end addEvent("onClientTimeChange") addEventHandler("onClientTimeChange", root, CTimeCheck) NOTE: Aceste eventuri merg doar daca folositi functiile (setTime & setWeather)
-
Daca am avea mai multe layere la setSkyGradient am putea face cerul cum e pe GTA V. Din pacate avem doar top & bottom rgb, oricum cred ca este posibil cu un obiect custom si shader pe el cu o textura.
-
interesanta idee
-
shader sau obiect custom?
-
Speed Effect & Nitro Effect Preview: https://streamable.com/89uc5l
-
Mai usor e fara _ la numele functiilor function FindValueInTable function FindValuePosInTable
-
local myMarker = createMarker(...) addEventHandler("onClientMarkerHit", myMarker, function(hit, dim) local vehicle = getPedOccupiedVehicle(localPlayer) if hit == localPlayer or hit == vehicle then if vehicle then setElementPosition(vehicle, x, y, z) setElementPosition(localPlayer, x, y, z) else setElementPosition(localPlayer, x, y, z) end end end)
-
Post a code, we can help you without it! I guess u need to put it like: addEventHandler("onPlayerSpawn", root, function() -- trigger your onPlayerFirstSpawn event end)
-
[WIKI] Account blocked
Hydra replied to FlorinSzasz's topic in Site/Forum/Discord/Mantis/Wiki related
Seems like you did something wrong -
Patesc asta de fiecare data cand ma apuc de un proiect, incep in forta si dupa mi se ia chefu dar tot ajung pana la capat sa termin ce imi propun
-
Nu gasesc o categorie adecvata pentru a posta link-urile acestea dar cea mai buna optiune ar fi aici: https://wiki.multitheftauto.com/wiki/RO/Main_Page - (Tradus in Romana, posibil sa fie mici greseli) https://wiki.multitheftauto.com/index.php?title=RO/Cum_Poti_Ajuta (Tradus in Romana, posibil sa fie mici greseli) https://wiki.multitheftauto.com/wiki/RO/createPed - (Tradus in Romana) https://wiki.multitheftauto.com/wiki/RO/getPedAmmoInClip - (Tradus in Romana) https://wiki.multitheftauto.com/wiki/RO/getPedArmor - (Tradus in Romana) O sa incerc sa traduc cat mai multe
-
Car Selector (Alpha) Preview: https://streamable.com/qqabrd
-
From what I understand, you want the balance of the money in the bank to be displayed in your HUD, right? Well, you will have to use setElementData and getElementData to see what amount you have in the bank Example: addEventHandler("onClientRender", root, function() local bankMoney = getElementData(localPlayer, "bankMoney") or 0 dxDrawText("Bank Blance: "..bankMoney.."", 100, 200, 30, 30, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top") end) --// I'm pretty sure you have an element data in your bank system, try to put it like on this example
-
Or if you have multiple objects in client-side, you can use this variant (not tested) --// Client local myObj1 = createObject(18450, 0, 0, 2) local myObj2 = createObject(18450, 100, 200, 20) function DestroyObject(theObject) local theObject = theObject or false if theObject ~= false then if getElementType(theObject) == "object" then destroyElement(theObject) end end end addEvent("DestroyObject", true) addEventHandler("DestroyObject", root, DestroyObject) --// Server function DeleteClientObjects(thePlayer, cmd, objName) if objName then triggerClientEvent(root, "DestroyObject", root, objName) end end addCommandHandler("delobject", DeleteClientObjects) --// Command Example /delobject myObj1 (it will destroy the myObj1 from client-side)