Forum: Grand Theft Auto Series Modding - Our GTA Modding Team is the best around. Tutorials & Topics related to modding your GTA games, trophies, and save files! Discuss GTA game modding with the knowledgeable members of PSX-Scene and the Official GTA IV Mod Team.


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Thread: [Help/Request] Multi-Function Presses
  

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22
  1. #1 Exclamation [Help/Request] Multi-Function Presses 
    sirmajor is offline Registered User
    Join Date
    Apr 2012
    Location
    C://
    Posts
    14
    Downloads
    1
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Ello peoples im just requesting some help for a script im trying to code and make for the community. Now i must say that im just beginning to code for GTA and so far so good but its just one bit that im currently stuck on.

    For example i have coded a mod that can switch to other mods that's inside the script(just one) now it seems to be working fine but its only the ones that are Key presses or in other words combo presses, the bit that confuses me is that when i activate the mod menu that i made .. it activates properly so i go through the mods( if i press left or right) and when i get the combo mod it wont work even if i stated in the script for it to work.
    If some one help me on this one i could make this script practically have any mod in this scrip without any bugs or such and lag free as well.

    It would be much help if any of the experienced coders can help me out on this one thanks ^.^
    Reply With Quote  

  2. #2  
    JDMAlex's Avatar
    JDMAlex is offline & developer
    Join Date
    Nov 2010
    Posts
    723
    Downloads
    5
    Uploads
    1
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    190
    Likes Received
    442
    Sorry...unless you show your script .. I don't know what your trying to do.

    All i can do is give you this:

    Code:
    void MenuActivate(void)
    {
               if((IS_BUTTON_PRESSED(0,BUTTONHASH_1)) && (IS_BUTTON_PRESSED(0,BUTTON_2)) )  //  0 is the index and BUTTON_1 is the one u set it too
               {
                      SomethingHappensNow;
                }
    }
    Reply With Quote  

  3. #3  
    sirmajor is offline Registered User
    Join Date
    Apr 2012
    Location
    C://
    Posts
    14
    Downloads
    1
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Thanks for trying though man , umm i would show you my script but i cant PM you for some odd reason so that gone out the window lol , i can try and describe it to yea if it helps. What you gave is the part im stuck on , its one of those that needs to work from a activated menu mod which you press and enabled , its a bit like On Off by the same combo. It wont let me do another one whilst that is activated even though i disabled it when doing the other command which is similar to the one gave example of XD
    Reply With Quote  

  4. #4  
    JDMAlex's Avatar
    JDMAlex is offline & developer
    Join Date
    Nov 2010
    Posts
    723
    Downloads
    5
    Uploads
    1
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    190
    Likes Received
    442
    well what I usually use is bool

    like:
    Code:
    bool SomeFunctionCounter=0;
    bool SomeFunctionSwitch=0
    void SomefunctionONorOFF(void)
    {
    	if ((IS_BUTTON_PRESSED(0, BUTTON_O)) && (IS_BUTTON_JUST_PRESSED(0, BUTTON_DPAD_UP)))
    	{
    		if (SomeFunctionCounter == 0)
    		{
    			SomeFunctionCounter = 1;
    			Print("ON");
    			SomeFunctionSwitch = 1;
    		}
    		else if(SomeFunctionCounter == 1)
    		{
    			SomeFunctionCounter = 0;
    			Print(" OFF");
    		}
    	}
    }
    
    
    void SomeOtherfunction(void)
    
    {
    	if((SomeFunctionCounter == 1) && (SomeFunctionSwitch == 1))
    	{
    		StartDoingStuff();
    
    	
    	}
    }
    void SomeOtherfunction2(void)
    
    {
    	if((SomeFunctionCounter ==0) && (SomeFunctionSwitch == 1))
    	{
    		StartDoingOtherStuff();
                    SomeFunctionSwitch=0;
    	}
    }
    looks kinda dumb but It kinda gives you an idea on what stuff u can to with it.(not sure of the name of this) but I like to think of them as light switches.

    is this what your after?
    Reply With Quote  

  5. #5  
    sirmajor is offline Registered User
    Join Date
    Apr 2012
    Location
    C://
    Posts
    14
    Downloads
    1
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Ill check these out man , and thanks. Hopfully these work , is there any possible way of sending you my code ?
    Reply With Quote  

  6. #6  
    JDMAlex's Avatar
    JDMAlex is offline & developer
    Join Date
    Nov 2010
    Posts
    723
    Downloads
    5
    Uploads
    1
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    190
    Likes Received
    442
    you could email it @ jdmalex2@hotmail.ca
    Reply With Quote  

  7. #7  
    sirmajor is offline Registered User
    Join Date
    Apr 2012
    Location
    C://
    Posts
    14
    Downloads
    1
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Alrighty im just gonna test out your example see if its the one if not ill be emailing you my code very shortly XD
    Reply With Quote  

  8. #8  
    spadger's Avatar
    spadger is online now Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    143
    Downloads
    2
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    29
    Likes Received
    29
    I think what you're wanting is a menu system without the displayed list menu, if you know what i mean. You cycle through the various function with one button press at a time until you highlight the function you want, then you press a selected button for the bool to switch, all the time the actual functions are checked continuously for this bool.
    Reply With Quote  

  9. #9  
    sirmajor is offline Registered User
    Join Date
    Apr 2012
    Location
    C://
    Posts
    14
    Downloads
    1
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Quote Originally Posted by spadger View Post
    I think what you're wanting is a menu system without the displayed list menu, if you know what i mean. You cycle through the various function with one button press at a time until you highlight the function you want, then you press a selected button for the bool to switch, all the time the actual functions are checked continuously for this bool.
    Yea correct lol , but the this is i would have to make another bool and etc to make another bit of code work , im just seeing if anyone knows another way of doing so of choosing the function without having a continuous loops. Ive seen what i needed but it isnt released for source i dont think , its in "Blue Script" when u can mod your car so theres toggles on that which u disable or enable.
    Reply With Quote  

  10. #10  
    spadger's Avatar
    spadger is online now Member
    Join Date
    Mar 2012
    Location
    UK
    Posts
    143
    Downloads
    2
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    29
    Likes Received
    29
    Quote Originally Posted by sirmajor View Post
    Yea correct lol , but the this is i would have to make another bool and etc to make another bit of code work , im just seeing if anyone knows another way of doing so of choosing the function without having a continuous loops. Ive seen what i needed but it isnt released for source i dont think , its in "Blue Script" when u can mod your car so theres toggles on that which u disable or enable.
    Just checking the bool conditions in a loop doesn't really add much, if they're not activated then there's no load to do other than just the check itself, don't worry about that. I do prefer this method though, as it cuts down on the amount of button combos, which i expect is your main reason also.
    Reply With Quote  

Page 1 of 3 1 2 3 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •