Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing SET_VEHICLE_MOD_KIT #111

Closed
ThomasTwomey opened this issue May 23, 2015 · 13 comments
Closed

Implementing SET_VEHICLE_MOD_KIT #111

ThomasTwomey opened this issue May 23, 2015 · 13 comments
Assignees

Comments

@ThomasTwomey
Copy link

ThomasTwomey commented May 23, 2015

I was trying to create a quick menu for changing the window tint of your current car. Here is my code:

Player player = Game.Player;

    active_menu = new GTA.Menu("Customization Menu", new GTA.MenuItem[] {
        new GTA.MenuButton("Tint Windows", () => {
            player.Character.CurrentVehicle.WindowTint = VehicleWindowTint.Limo;
            UI.Notify("Windows Tinted");
        })
   });

The UI displays a message so the button works, but the windows do not change tint. I don't know if the code is wrong or if it's an issue with Scripthookdotnet. Any help is appreciated!

@IncoCode
Copy link
Contributor

IncoCode commented May 23, 2015

Try to call

Function.Call( Hash.SET_VEHICLE_MOD_KIT, veh.Handle, 0 );

before applying new tint.

@ThomasTwomey
Copy link
Author

ThomasTwomey commented May 23, 2015

Works perfectly now. Thank you for the help!

@JohnnyCrazy
Copy link
Collaborator

JohnnyCrazy commented May 24, 2015

Mh...Would be good if we have this in a method, what about veh.EnableModKit?

@IncoCode
Copy link
Contributor

IncoCode commented May 24, 2015

Or we can just call this SET_VEHICLE_MOD_KIT function in SetMod method, WindowTint setter etc.

@JohnnyCrazy
Copy link
Collaborator

JohnnyCrazy commented May 24, 2015

Mh, this would create a lot of unnecessary calls, wouldn't it? Or do you have to call it before every mod-change?

@IncoCode
Copy link
Contributor

IncoCode commented May 24, 2015

Not before every, but as far as I remember after certain time you should call this function again.

@JohnnyCrazy
Copy link
Collaborator

JohnnyCrazy commented May 24, 2015

Then I think we should go with the extra-method.

@crosire
Copy link
Owner

crosire commented May 24, 2015

Or set a boolean in the vehicle class and only call it if it's not yet set to true?

@IncoCode
Copy link
Contributor

IncoCode commented May 24, 2015

@crosire , no. Like i said, after some time you should call this function again. Just go in LSC, then leave LSC and try to call SetMod method - it's works, wander around some time, try SetMod method again - it's don't work.

@crosire
Copy link
Owner

crosire commented May 24, 2015

Then save a DateTime and check if the last call is over a certain limit.

@IncoCode
Copy link
Contributor

IncoCode commented May 24, 2015

@crosire , yeah, but i don't know after which time exactly it ceases to work and on what this time depends.

@JohnnyCrazy JohnnyCrazy changed the title Setting Window Tint of Current Vehicle Does Not Work Implementing SET_VEHICLE_MOD_KIT May 28, 2015
@crosire
Copy link
Owner

crosire commented Jun 8, 2015

I'd just do it like @IncoCode originally proposed. Call it on every SetMod etc. It's the safest way.

@JohnnyCrazy
Copy link
Collaborator

JohnnyCrazy commented Mar 28, 2016

Closed by 4941bc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants