Jump to content

Little help with interactive panel... GTA SA


Recommended Posts

First of all, English is not my native language, if they feel that my writing is awful.
I'm doing an interactive panel and well, I've already read how this works from Sanny Builder (this is my first post and also my first experience with programming).
I know the syntax is as follows (for example):
08D4: 0 @ = create_panel_with_title 'CHT12' position 200.0 120.0 width 220.0 columns 1 interactive 1 background 1 alignment 0
The function to skip from button to button is working automatically with the keys UP / DOWN as well with W / S and also G / H
But nothing else ...
And I would like to know if you can navigate the panel with other buttons, (for example: with 'Q' and 'E'.
I know you can set the buttons with which you can enter and exit the panel, so I guess you can change which buttons you can navigate with, right?
Thanks for your attention.

 

Link to comment
https://gtaforums.com/topic/883078-little-help-with-interactive-panel-gta-sa/
Share on other sites

Read ZAZ tutorials, everything you need to know is there.

 

About your second question: yes, i guess you can control the panel with alternative buttons.

 

There is an opcode to manipulate active row:

090E: set_panel $1153 active_row $1148

So your code should check if you pressed "Q" or "E", and then add or substract the active row, and call 090E.

I never tried, but it should work.

@: Sloth , he already have read the tut because he posted my usage:

"The function to skip from button to button is working automatically with the keys UP / DOWN as well with W / S and also G / H
But nothing else ..."
and his question is, if there's an alternatively code for the navigation instead the hardcoded keypress function by UP / DOWN as well with W / S and also G / H
The answer is NO
Edited by ZAZ

 

@: Sloth , he already have read the tut because he posted my usage:

"The function to skip from button to button is working automatically with the keys UP / DOWN as well with W / S and also G / H
But nothing else ..."
and his question is, if there's an alternatively code for the navigation instead the hardcoded keypress function by UP / DOWN as well with W / S and also G / H
The answer is NO

 

Mmm...Well ... at least I tried.

Thanks dude, and yes, I had already read your tut xD

But you could manipulate panel "by hand", right? :blush:

Of course i consider it impractical, because default buttons are more intuituveI.

I know it is more comfortable to navigate with W / S, UP / DOWN, G / N.

I can't say the reason why I wanted to change the navigation buttons ... it's a secret ....

 

{$CLEO}0A8C: write_memory 0x5809AB size 1 val 0x0A vp 1 // replace 'G' with 'E'0A8C: write_memory 0x5809B2 size 1 val 0x3A vp 1 // replace 'G' with 'E'0A8C: write_memory 0x580A76 size 1 val 0x0E vp 1 // replace 'H' with 'Q'0A8C: write_memory 0x580A7D size 1 val 0x3E vp 1 // replace 'H' with 'Q'0A93: terminate_this_custom_script

plugin-sdk: More ellegant solution (without replacing 'G' and 'H' keys:

 

#include "plugin.h"#include "game_sa\CControllerConfigManager.h"using namespace plugin;class MyMenuControls {public:    static bool MyCheckForMenuUp() {        return CallAndReturn<bool, 0x540950>() || CallMethodAndReturn<bool, 0x52E450>(&ControlsManager, 'E');    }    static bool MyCheckForMenuDown() {        return CallAndReturn<bool, 0x540980>() || CallMethodAndReturn<bool, 0x52E450>(&ControlsManager, 'Q');    }    MyMenuControls() {        patch::RedirectCall(0x580984, MyCheckForMenuUp);        patch::RedirectCall(0x580A4F, MyCheckForMenuDown);    }} myPlg;
Edited by DK22Pac
{$CLEO}0A8C: write_memory 0x5809AB size 1 val 0x0A vp 1 // replace 'G' with 'E'0A8C: write_memory 0x5809B2 size 1 val 0x3A vp 1 // replace 'G' with 'E'0A8C: write_memory 0x580A76 size 1 val 0x0E vp 1 // replace 'H' with 'Q'0A8C: write_memory 0x580A7D size 1 val 0x3E vp 1 // replace 'H' with 'Q'0A93: terminate_this_custom_script
plugin-sdk: More ellegant solution (without replacing 'G' and 'H' keys:

 

#include "plugin.h"#include "game_sa\CControllerConfigManager.h"using namespace plugin;class MyMenuControls {public:    static bool MyCheckForMenuUp() {        return CallAndReturn<bool, 0x540950>() || CallMethodAndReturn<bool, 0x52E450>(&ControlsManager, 'E');    }    static bool MyCheckForMenuDown() {        return CallAndReturn<bool, 0x540980>() || CallMethodAndReturn<bool, 0x52E450>(&ControlsManager, 'Q');    }    MyMenuControls() {        patch::RedirectCall(0x580984, MyCheckForMenuUp);        patch::RedirectCall(0x580A4F, MyCheckForMenuDown);    }} myPlg;
Well ... that worked ... but it really is not what I'm looking for, I did't want to say it because it's a project but ... I wanted to make an interactive panel only for the second player, since the panels can only be moved by the first player
Is there any way that the second player can interact with the panels?

Is there any way that the second player can interact with the panels?

Yes, there's some secret way for your secret project.

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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