Jump to content

amirmahdi

Members
  • Posts

    36
  • Joined

  • Last visited

Recent Profile Visitors

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

amirmahdi's Achievements

Rat

Rat (9/54)

3

Reputation

  1. guys I want to do something that when "player1" hits "player2" car, give "player1" 3 Wanted Note : I mean the car A car is like a police car In the code, only the car that has ID 596 should be mentioned But I do not know how to implement it as code Please help me with this. Thanks
  2. I was finally able to fix it Via getElementByID Thanks again for your help and attention, bro
  3. I mean, I did not differentiate between configurations Police cars have "police" license plates, I'm sure about that And the only problem is that in the code I sent above, I tried to make it respond only to cars that have police license plates. But unfortunately, in addition to police cars, other cars also respawn
  4. Yes, I confirm No
  5. I got it, thank you Is it possible to make cars with police license plates respawn every 10 minutes? I wrote it, but the problem is that it respawn all the cars on the map for index, policecars in ipairs(getElementsByType("vehicle")) do local plate = getVehiclePlateText ( policecars ) if (plate) == "police" then toggleVehicleRespawn ( policecars, true ) setVehicleIdleRespawnDelay ( policecars, 100000000 ) -- 10 Min end end
  6. thanks bro Worked ! Do you know where I can find the TXD file of gta models? Thanks for making a great software called Magic.TXD Thank you very much
  7. Hello The_GTA I finally solved the previous problem Thanks so much for the tips Is it possible to show the blip only for a specified team? Like the code below But the problem is that the clip is not made at all Or if it happens, it is not visible to anyone function test() if getElementData(source,"vehdamyu") == false then setElementData(source,"vehdamyu",true) blipes = createBlipAttachedTo( source, 0, 2, 50, 50, 255, 255 ) --This setElementVisibleTo(blipes,getRootElement(),false) -- this setElementVisibleTo(blipes,getTeamFromName("Police"),true) -- This end end addEventHandler("onVehicleDamage", root, test)
  8. Excuse me buddy my English is week And I use the translator most of the time Is it possible to code the steps that explain the video to me?
  9. In the following code, the player executes 'setTimer' by pressing the E button ... setTimer(showvehexplodedordamaged,1000,1,thePlayer) ... And executes the following code The function of this code is to show damaged or exploded cars on the map function showvehexplodedordamaged (thePlayer) for i, v in ipairs(getElementsByType("vehicle")) do if getElementHealth(v) < 1000 then blips = createBlipAttachedTo( v, 0, 2, 50, 50, 255, 255 ) setElementVisibleTo(blips, getRootElement(), false) setElementVisibleTo(blips, thePlayer, true) end end end So far, our code is doing its job and there is no problem We said that this code shows damaged or exploded cars on the map But the problem is that if the damaged or exploded car is fixed, it still shows it on the map !!! How do I solve this problem?
  10. Thankful Is there just a way to show the location of the cars that exploded on the map? (As a blip)
  11. 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?)
  12. 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
  13. Yes, you are the only one who can help me Because you made me learn more and that solved a lot of my problems
  14. Ooooooh Man That was right Thanks so much for helping again
  15. 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
×
×
  • Create New...