Jump to content
alpfa

Increasing Health Method i.e Command(A question for Coders) - Miniscript

Recommended Posts

Hey I want to increase my health, ammo, etc  with a script, what are the methods to do this? I have putting this into a miniscript with a keybind attached to it, thanks.

Share this post


Link to post
Share on other sites

Use the little squiggly line key by the number 1 and then type in heal and press enter. It will heal you and your car.

Share this post


Link to post
Share on other sites

Then learn scripting bud. 

 

 EDIT:

Didnt read his post correctly. 

Thought he was asking for someone to script it for you. 

OP: Sorry for being rude.

Others: Thanks for the -1 votes. They helped me notice my mistake :) 

Edited by Beckugan1

Share this post


Link to post
Share on other sites

That's what he's doing...

@alpfa: You should check out the IRC channel @gtaivnetscripthook on freenode. It's a great place to get scripting help.

Share this post


Link to post
Share on other sites

If you are using C# it should be something like this or similar. Always use VisualStudio to script. It will prompt you possible methods and properties with description.

 

Game.LocalPlayer.Health = 100;
Game.LocalPlayer.Weapons.CurrentWeapon.Ammo = 999;

Share this post


Link to post
Share on other sites

If you are using C# it should be something like this or similar. Always use VisualStudio to script. It will prompt you possible methods and properties with description.

 

Game.LocalPlayer.Health = 100;

Game.LocalPlayer.Weapons.CurrentWeapon.Ammo = 999;

 

 

These aren't correct for C#.  The variables are located in  Player.Character.

 

E.g.:    Player.Character.Health = 100;

 
Edited by Braveheart

Share this post


Link to post
Share on other sites

Forgot about Character part, but Game.LocalPlayer issame as Player. Also Player probably will not be available any more in next Scripthook version.

Share this post


Link to post
Share on other sites

If you are using C# it should be something like this or similar. Always use VisualStudio to script. It will prompt you possible methods and properties with description.

 

Game.LocalPlayer.Health = 100;

Game.LocalPlayer.Weapons.CurrentWeapon.Ammo = 999;

 

Thanks alot but as BraveHeart said it's with Player but yeah thanks a lot guys.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×