Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
ikt

[C++/ScriptHook]Some questions

Recommended Posts

ikt

Hello there. I am in process of creating something and it started to go well! Now I don't know some commands so I'll use this thread to ask it.

 

I want to use GetCharArmour(PlayerChar, aArmor). But what type or something else is aArmor? I tried things, but they're 'incompatible with parameter of u32'. So what does it have to be?

 

Also I want a sort of timer and something that displays the amount of time left on screen, preferably in a form like a bar. How would I do that? Sjaak on another forum was so kind to help me, but I don't know what to do with this piece of code:

 

SetTimerA(0); //timer op 0m_State = Stateblah; //veranderen van de statecase Stateblah:{if (TimerA() > 1000) //na een seconde{do something;m_State= StateDefault; //terug naar de default state, keypresses en tick processing}}break;

 

Where do I place it? Adding it only created headache for me tounge.gif

Share this post


Link to post
Share on other sites
Symbiote

I'm kind of a programming noob, but to me u32 suggests "unsigned 32-bit integer".

Share this post


Link to post
Share on other sites
Kucikuc24

AngryAmoeba: You've right

 

Everything, what do you need is defined in Scripting.h. And try to use SampleCustomFiber, it s better than SampleCustom...

 

Here is that Armour:

 

static void GetCharArmour(Ped ped, u32 *pArmour)u32 armour;GetCharArmour(GetPlayerPed, &armour);

 

Share this post


Link to post
Share on other sites
ikt

 

AngryAmoeba: You've right

 

Everything, what do you need is defined in Scripting.h. And try to use SampleCustomFiber, it s better than SampleCustom...

 

Here is that Armour:

 

static void GetCharArmour(Ped ped, u32 *pArmour)u32 armour;GetCharArmour(GetPlayerPed, &armour);

 

Wait, so u32 does the trick?

sh*t, I'm stupid. Thanks smile.gif About the SampleCustomFiber, why would that be better? Someone said it wasn't the most stable one to use.

 

Other questions:\

- now I have multiple functions in my mod, but how do I force it to just have just one at the time enabled? (like when you activate something, the other things that is engaged stops)

- where can I find the functions that have something to do with character movement speed and the force melee applies?

Edited by ikt

Share this post


Link to post
Share on other sites
ikt

Bumpitybump and another question:

 

 

       eWeapon wap;       GetCurrentCharWeapon(PlayerChar,&wap);       SetObjectAlpha(wap, 110);

 

This won't work for fading weapons, is this because of the games engine, or am I doing something wrong? Thanks smile.gif

I think it's the game, because when a weapon is dropped and I walk away, it's always clear and sharp and doesn't disappear like the cans on the ground near it.

Share this post


Link to post
Share on other sites
Kucikuc24
Bumpitybump and another question:

 

 

       eWeapon wap;       GetCurrentCharWeapon(PlayerChar,&wap);       SetObjectAlpha(wap, 110);

 

This won't work for fading weapons, is this because of the games engine, or am I doing something wrong? Thanks smile.gif

I think it's the game, because when a weapon is dropped and I walk away, it's always clear and sharp and doesn't disappear like the cans on the ground near it.

oou maan, fatal mistake...eWeapon is enum and Object is sripting...so, you have to try to find some function for getting object from weapon and than apply Alpha...

Share this post


Link to post
Share on other sites
ikt

 

Bumpitybump and another question:

 

 

       eWeapon wap;       GetCurrentCharWeapon(PlayerChar,&wap);       SetObjectAlpha(wap, 110);

 

This won't work for fading weapons, is this because of the games engine, or am I doing something wrong? Thanks smile.gif

I think it's the game, because when a weapon is dropped and I walk away, it's always clear and sharp and doesn't disappear like the cans on the ground near it.

oou maan, fatal mistake...eWeapon is enum and Object is sripting...so, you have to try to find some function for getting object from weapon and than apply Alpha...

Thanks, I'll look into it biggrin.gif

 

I tried this:

 

Object wap;GetWeaponTypeModel(PlayerIndex,wap);SetObjectAlpha(wap, 110);

 

 

It won't work because somehow the weapon model is still eWeapon.

 

sad.gif

 

Other question: How do I display a value onscreen?

Edited by ikt

Share this post


Link to post
Share on other sites
Kucikuc24

OMG you cannot convert enum to scripting ! Go and learn C++

Share this post


Link to post
Share on other sites
Symbiote

You can display a value on screen like this:

 

Game.DisplayText(value);

Share this post


Link to post
Share on other sites
Kucikuc24
You can display a value on screen like this:

 

Game.DisplayText(value);

Mayby offtopic ? And pls stop with that stupid .NET :l

Share this post


Link to post
Share on other sites
lindsayslorach

@AngryAmoeba - I'm pretty sure he's uding C++, not C#.

 

I would suggest learning C#, it's quite easy to do simple things with the game. And I'm not the best, but I can help you with it if you like.

 

There are some other people here that can help too, I've had some very good help with C# from people in theses forums.

Share this post


Link to post
Share on other sites
Symbiote

I can't even tell the difference between C# and C++. biggrin.gif

 

me = noob;

Share this post


Link to post
Share on other sites
Kucikuc24

C# is simpliest and much older than C++, C# for example doesnt have bools, C++ is using moore own libs, ...

Share this post


Link to post
Share on other sites
lindsayslorach

C# doesn't have bools? Have you used C#? I don't think so. It does have bools.

 

Theres nothing wrong with C#, many professional applications are written in C#.

Share this post


Link to post
Share on other sites
Kucikuc24

No, C# doesnt have bools...but you can use int, it s something similar...

 

Yeah C# is really good, it s better than C++ and i m using it for coding software for PSP smile.gif...

But ScriptHooks enviroment was made for C++...

Edited by Kucikuc24

Share this post


Link to post
Share on other sites
lindsayslorach

Bools.. as in booleans.. as in true or false. Yes, C# does have them, no, you dont use ints.

Share this post


Link to post
Share on other sites
Donny78

He means (I think) the conversion issue, you can't use int as bool in C# but you can in C++.

Share this post


Link to post
Share on other sites
lindsayslorach

I thought he might have meant something like that, it's just his post confused me, because its backwards..

 

 

No, C# doesnt have bools...but you can use int, it s something similar...

 

I think he might be confusing the two. In C# you can't use ints as bools.

Edited by lindsayslorach

Share this post


Link to post
Share on other sites
Symbiote
C# is simpliest and much older than C++

Wikipedia says C++ is 18 years older than C#...

Share this post


Link to post
Share on other sites
Kucikuc24
C# is simpliest and much older than C++

Wikipedia says C++ is 18 years older than C#...

LoL biggrin.gif

Share this post


Link to post
Share on other sites
ikt

Can you modify memory addresses with ScriptHook?

Share this post


Link to post
Share on other sites
Kucikuc24

What do you mean ?

Share this post


Link to post
Share on other sites
ikt
What do you mean ?

Modify the amount of physics power when fighting by changing a value through the memory addresses. There isn't a native function for that, modifying the value is the most reliable way to 'push' the cars. (If you know something better, please enlighten me.)

Share this post


Link to post
Share on other sites
Kucikuc24

yeah you can ! Just find addresses for this functions and in scripting.h of your thread make your own NATIVE smile.gif

 

And if you found it, can you place here pls ? smile.gif

Share this post


Link to post
Share on other sites
ikt

Addresses didn't work well.

 

Is it possible running two seperate 'threads'? I need one that's contagious and one with a timer, because if I combine the two, sh*t goes wrong.

Share this post


Link to post
Share on other sites
Kucikuc24

yeah, just link that smile.gif

Share this post


Link to post
Share on other sites
ikt
yeah, just link that smile.gif

How do I do that? Multiple files? Or what?

Share this post


Link to post
Share on other sites
ikt

Nevermind that.

 

I have gotten the run/sprint animation while holding a rifle, but I can't find the normal running animation with no guns/small arms.

 

Nope:

move_melee run

 

All other seem not right, because it would be strange if R* used a mission animation for the most normal thing done in GTA: Running with a small gun.

 

Okay, GTAModding just didn't mention it, but move_generic or something and run works okay.

Edited by ikt

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.