amirmahdi
Members-
Posts
52 -
Joined
-
Last visited
Everything posted by amirmahdi
-
Hello again ? Is there a way to show the cars that exploded on the map? For example, the following code shows players that have Wanted ! ... for i, v in ipairs(getElementsByType("player")) do if getElementHealth(v) < 100 then if getElementData(v,"loggedIn") then blips = createBlipAttachedTo( v, 0, 2, 255, 255, 100, 100 ) setElementVisibleTo(blips, getRootElement(), false) setElementVisibleTo(blips, thePlayer, true) setElementData(thePlayer,"jobs:police",blips) end end end ... This is just one problem with this example When the Wanted player is gone, it will still be displayed on the map (can this be fixed?)
-
Hello buddy I want to give Health to other Players on the server by pressing a button. Of course, only players that are close to us. And that I did this using the previous code you provided. But this is the problem. I want this to be done only for other people That means we should not give ourselves health Code : local function findClosestplayer(elem) local vehicles = getElementsByType("player"); local elem_x, elem_y, elem_z = getElementPosition(elem); local closest_veh = false; local closest_dist = false; for m,veh in ipairs(vehicles) do local veh_x, veh_y, veh_z = getElementPosition(veh); local dist = getDistanceBetweenPoints3D(elem_x, elem_y, elem_z, veh_x, veh_y, veh_z); if not (closest_dist) or (closest_dist > dist) then closest_dist = dist; closest_veh = veh; end end return closest_veh; end function medic (thePlayer) local veh = findClosestplayer(thePlayer); if veh then local x1,y1,z1 = getElementPosition(thePlayer) local x2,y2,z2 = getElementPosition(veh) local distance = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if tonumber(distance) < 2.5 then setElementHealth(veh,100) end end end
-
Yes, you are the only one who can help me Because you made me learn more and that solved a lot of my problems
-
Ooooooh Man That was right? Thanks so much for helping again
-
Hi Again I had a strange problem Bad argument @ 'getResourceRootElement' [Expected resource-data at argument 1] [string "?"] Code : ( serverside ) local invSys = exports["inv"] function whenPlayerLeft() invSys:setInvData(getPlayerName(source),"i1",getElementData(source,"invs1")) -- Warning is Here end addEventHandler("onPlayerQuit", getRootElement(), whenPlayerLeft) I did not use the getResourceRootElement function but it warns ?
-
I wrote with the help of getDistanceBetweenPoints3D, thank you; )
-
Hello buddy This can be done Fix only cars that are half a meter away from us?
-
Thank you very much for everything Bravo
-
Oh how dumb I am. Thankful I need another little help This is the client side code What can I do to avoid the following warning? WARNING: testres\c.lua:4:Bad argument @'getVehicleType'[Expected number at argument 1,got boolean] addEventHandler( "onClientRender", root, function() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) local vehType = getVehicleType(theVehicle) -- Warning is Here if vehType == "Plane" or vehType == "Helicopter" then showfor = false end --Info : The code continues from here and includes dxDraw functions That's why onClientRender is used end)
-
Oh man I'm confused? (Thank you for all your help) It can be easily soured without worries For example, define coordinates in a table where the system remembers which coordinates are close to the car in the water. Can you tell me the code?
-
Of course, I solved the previous one myself If possible, help me in the text below? Something can be done When the car falls into the water, move the car to the nearest land?
-
Hi again How do I write a condition to continue the code when the player is out of the water? Something like that intt = 10 if isElementInWater(getLocalPlayer()) then intt = 20 end if Getoutofthewater(getLocalPlayer()) then --Getoutofthewater (example) intt = 30 end Client !
-
There is a way that the code remembers the first two letters of the car plate and if Did the code match the given letters to continue ? for example function respawnExplodedVehicle() for index, free_car1 in ipairs(getElementsByType("vehicle")) do local vehplate = getVehiclePlateText ( free_car1 ) if vehplate == "FR" then -- "FR" Specified letters cancelEvent() else setTimer(respawnVehicle,2000,1,free_car1) setElementData( free_car1 ,"fuel",105) end end end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle)
-
Your man was a great angel. Thank you
-
So it does not matter if the car exploded? Because I thought fixVehicle functions would only work for damaged machines
-
This is my code and I mentioned the problems above ---- Serverside ! local function findClosestVehicle(elem) local vehicles = getElementsByType("vehicle"); local elem_x, elem_y, elem_z = getElementPosition(elem); local closest_veh = false; local closest_dist = false; for m,veh in ipairs(vehicles) do local veh_x, veh_y, veh_z = getElementPosition(veh); local dist = getDistanceBetweenPoints3D(elem_x, elem_y, elem_z, veh_x, veh_y, veh_z); if not (closest_dist) or (closest_dist > dist) then closest_dist = dist; closest_veh = veh; end end return closest_veh; end addCommandHandler("repaire", function(player) local veh = findClosestVehicle(player); if getPlayerName(player) == getElementData(veh, "owner") then local getfueldb = tonumber(getElementData(vehSys:getVehicleData(veh),"vFuel")) respawnVehicle(veh,veh_x, veh_y, veh_z,0,0,200) setElementData(veh,"fuel",getfueldb) else outputChatBox("This is not your car !",player,255,0,0,true); end end );
-
hi again Honestly, this is the reason why I am annoyed When the car is healthy, one of the car wheels disappears. And that if we have two cars and they both explode. When we repair the first car, the second car is repaired in the place of the first car instead of being spun in the same place of explosion. Edit : Of course, the problem of the wheels is not very important
-
Hi Again ? Is it possible to specify in the resource if this resource is run on another IP server, give an error? I mean the resource only works on the IP we define
-
yes i m using an online hash My problem was solved while using your code The new code gave me the text in the license file as a hash and my problem was solved Thank you for taking the time to help me, brother
-
No, unfortunately not?
-
sorry It is possible to look at my file to see where the problem comes from? Because in the console it gives me the following error Although I did the steps you mentioned my resource : https://www.mediafire.com/file/u1cdn3wnozwhqij/Fly.rar error : [18:30:16] ERROR: Fly\server.lua:24: FATAL ERROR: LICENSE file has changed!
-
Hello again my friend Thank you for your great help I just had one more question For example, you can create a file in the resource if it is deleted or changed. Do not continue to use that resource Something like the following resource? This : https://www.mediafire.com/file/i5vsu0fxu8oyvdc/HUD.rar When the LICENSE file is deleted or changed, the resource will no longer work
-
Hello my friends I want the player near the car to use the CMD when the car breaks down(exploded) and the car to be repaired( respawnVehicle() ) Please help me in this matter?
-
Hi friends, I have a small problem In the console it gives this warning Bad argument @ 'setElementModel' [Expected element at argument 1, got number '100'] Which corresponds to the following line setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) cods ---- admin duty skin ---- addCommandHandler("a209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementData(accSys:getPlayerAcc(thePlayer), "dSkin", 209) setElementModel (thePlayer, 209) end) --- admin off skin ---- addCommandHandler("o209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) end) in part of ---- admin duty skin ---- There is no problem in the ---- admin duty skin ---- part but In the second part, --- admin off skin ----, when I order, Warning comes The second part must set the player model from the part of cSkin But it does not and gives high warning Sorry for the bad English language Please help me, my only hope is you
