Log in to reply
 

Need help with a script



  • I'm working with Script Hook V Dot Net (coding under C#) and have recently posted a simple script to remove the infinite parachutes you have after you complete a certain mission.

    The problem is, that specific script also removes the ability to purchase parachutes from AmmuNation, since as soon as you buy a parachute, it gets removed from your inventory instantly, since I put the REMOVE_WEAPON_FROM_PED under "void OnTick".

    How do I make it so that the permanent parachutes you get after completing a certain mission get removed, but when the player buys one from AmmuNation it stays in his inventory and can be used one time?

    I'm new to scripting and I would like advice/code to achieve this with. Thanks!



  • Why would you need a script for that? I know there's a lot of people who are just immersion miners like me but it's really not worth life time... You can manually remove them with the Simple Trainer. But if you might not care I have a list of suggestions: http://www.dev-c.com/nativedb/
    Look this page up for any useful natives. Look into the GAMEPLAY section.
    What I would recommend were I you is to get the X Y Z coordinates of every AmmuNation entrance and put them into a list.
    Then in onTick check if the player entered the AmmuNation and set a bool "inAmmu = true" and do a Script.Wait(time) if necessary. If it's true disable the REMOVE_WEAPON_FROM_PED function and replace it witch checking if the player has a parachute. If you exit ammu without a parachute then set inAmmu = false and continue with the remove parachute tick. If you buy a parachute while inAmmu = true then do a while loop that checks if the player still has the parachute then do nothing. If the parachute was used and the condition is now false then start removing the parachute loop again until you enter AmmuNation again.

    for (int index = 0; index < AmmuNationEntrances.Count; ++index)
    {
    if (World.GetDistance(Game.Player.Character.Position, AmmuNationEntrances[index]) < 3)
    do what I said

    Hope it helps!



  • @Eyon Simple Trainer, or any other trainer, does not remove the parachute. Every time I select the option to remove it it automatically gets added back to my inventory. I took time to make that script in order for the parachutes to get removed permanently.

    Thanks for the help though, I'll see what I can do


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.