Jump to content

Zorgman

Members
  • Posts

    256
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Zorgman

  1. https://github.com/Zorangeorge/MTA-Dystopia-The-Incident/tree/master/[Dystopia]/dystopia_core

    Look in here, there are two scripts, climbing_client and climbing_server. You can take them out and put them in a standalone resource.

    It works with two or three types of ladder (object ids); face the ladder and double-jump to get on it; climbing down not implemented (you can move up and down on the ladder, but if you are on a roof you cannot really mount the ladder to descend)

    Credits go to Slothman for his superhero resource (I just took the Spiderman wallclimb superpower and restricted it into simple ladder climbing for my own use)

    Good luck!

    • Thanks 1
  2. Attaching the ped to an element will effectively keep it in the designated place, the 'updatePosition' parameter will not work. I haven't seen yet a solution to this (peds jacking cars or even peds entering a vehicle using the normal mechanics); I think it can be done, though likely would not look as good as in SP, since cutting some corners would be necessary.

    You need to calculate the positions required, make sure the vehicle is stationary (maybe even freeze it for a short while), make the ped walk to the car door and play the animation, you open the car door by script (on a loop if you want to see actual motion and not simply 'snap' it open), warp out the driver, move it in the right position and have it play the animation, finally warping the hijacker inside.

    • Thanks 1
  3. local vehicleplate = result[1]["plate"]
    local x = result[1]["posX"]
    local y = result[1]["posY"]
    local z = result[1]["posZ"]
    
    local nearby  = 20
    
    if getDistanceBetweenPoints3D(x, y, z, getElementPosition(player)) <= nearby then
      
    	outputDebugString("Vehicle is nearby")
    
    end 

    Something like this maybe?

    I assumed that you store the vehicle position in the dB, I also assumed the keys for that :)

  4. function onVehicleDamage(attacker, wep, loss, x, y, z, tire)
      if getElementType(attacker) == "player" then
            if (exports.team:isPlayerInTeam(getVehicleOccupant(source), "TSK") and exports.team:isPlayerInTeam(attacker, "TSK")) then
                cancelEvent(true)
            elseif (exports.team:isPlayerInTeam(getVehicleOccupant(source), "WSP") and exports.team:isPlayerInTeam(attacker, "WSP")) then
                cancelEvent(true)
    		end
      end
    end
    addEventHandler("onClientVehicleDamage", root, onVehicleDamage)

    This should do it.

  5. The source of onClientVehicleDamage event is the vehicle that got damaged.

    So your code is checking if the vehicle is in a team - you probably want to run your checks on the vehicle driver instead. You can use

    player getVehicleOccupant ( vehicle theVehicle, [ int seat=0 ] )  

     

  6. Thanks IIYAMA! But I think you misunderstood me: I do want to see the effects, only that I need them to appear lower, at 85 height instead of the default 170(?).

    Something similar could be scripted, probably... Anyway, you confirmed what I knew, that I can only disable them :( I wanted to use them as cheap self-managed effects for a wasteland-type map.  We could use a function for it, perhaps more people would like to use them like this? They provide good atmosphere imo.

    Cheers

  7. Is there a way to change the height at which clouds and fog effects start to appear?

    Not talking about the weather type, but about the fog that appears when you climb high enough, on the slopes of Mount Chilliad for instance. I get the effect when I position the map at z=185, but unfortunately I need it 100 units lower ?

    unknown1.png

    Thanks!

  8. I didn't knew about saveMapData either, this was actually what I was looking for so I tried it first, but it produced an xml file with empty object elements, not sure what i messed up ? Patrick's solution worked for me, I got my map. Thank you both!

    • Like 1
×
×
  • Create New...