SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/04/2012, 03:26 PM   #1
2KY
Gangsta
 
2KY's Avatar
 
Join Date: Jan 2012
Location: United States
Posts: 950
Reputation: 166
Default Re-initializing the mouse?

I tried to do something like this;

pawn Code:
else if( clickedid == startup1 ) // Login
        {
            if( fexist ( accPath ( playerid ) ) ) //They exist, this is good! Let them continue.
            {
                INI_ParseFile( accPath ( playerid ), "LoadAccount_%s", .bExtra = true, .extra = playerid);

                ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Access your account", "Please login to your account using your unique password that you set when you created it.", "Submit", "Back" );
            }

            else if( !fexist ( accPath ( playerid ) ) ) //They don't have an account, but they're hitting 'Login'? Why?
                return ShowPlayerDialog( playerid, DIALOG_BLANK, DIALOG_STYLE_MSGBOX, "You can't do that!", "ACTION FAILED\n\nYou don't have an account! Why are you trying to login to something that is non-existant?\n\nPlease click \"Create an Account\" to create an account!", "OK", "" );

        }

pawn Code:
case DIALOG_LOGIN:
        {
            if ( response )
            {
                if( !strlen ( inputtext ) )
                    return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Incorrect password!", "You have entered an incorrect password. Please try again!\n\nNot your account? Type \"/q\" and change your name in the SA:MP browser!", "Submit", "Back" );

                if ( udb_hash ( inputtext ) == accInfo [ playerid ] [ Passcode ] )
                {
                    INI_ParseFile( accPath ( playerid ), "LoadAccount_%s", .bExtra = true, .extra = playerid);

                    accLoggedIn [ playerid ] = 1; // They are now 'logged in'!

                    GivePlayerMoney ( playerid, accInfo [ playerid ] [ Cash ] );

                    HideStartupTextdraws( playerid );

                    SetSpawnInfo ( playerid, 255, accInfo [ playerid ] [ Model ], 0, 0, 10.0, 0.0, 4, 1, 24, 999, 31, 100 );
                    SpawnPlayer ( playerid );
                }
                else return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Incorrect password!", "You have entered an incorrect password. Please try again!\n\nNot your account? Type \"/q\" and change your name in the SA:MP browser!", "Submit", "Back" );
            }
            else if ( !response )
            {
                //They hit 'back'
                SelectTextDraw( playerid, 0xC90411FF );
            }
        }

However, when they hit back, their mouse disappears. (even though I redid SelectTextDraw), what's wrong?
__________________
Check out my wiki page
2KY is offline   Reply With Quote
Old 22/04/2012, 03:50 PM   #2
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,219
Reputation: 976
Default Re: Re-initializing the mouse?

Could be a SA:MP bug due to the fact that responding to a dialog hides the cursor, I shall test it.

P.S.
pawn Code:
//They don't have an account, but they're hitting 'Login'? Why?
why give them that option then? >.>


I've tested enabling TD selection, showing a dialog then responding to that dialog, and it works fine.
__________________
Click banner above for more info. View trailers here.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 22/04/2012, 04:06 PM   #3
2KY
Gangsta
 
2KY's Avatar
 
Join Date: Jan 2012
Location: United States
Posts: 950
Reputation: 166
Default Re: Re-initializing the mouse?

Quote:
Originally Posted by MP2 View Post
Could be a SA:MP bug due to the fact that responding to a dialog hides the cursor, I shall test it.

P.S.
pawn Code:
//They don't have an account, but they're hitting 'Login'? Why?
why give them that option then? >.>


I've tested enabling TD selection, showing a dialog then responding to that dialog, and it works fine.
I'd rather not have to reformat my 'menu' according to their account status.

@I've... : Why doesn't this work?
__________________
Check out my wiki page
2KY is offline   Reply With Quote
Old 22/04/2012, 04:58 PM   #4
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,219
Reputation: 976
Default Re: Re-initializing the mouse?

You never cancel the TD selection. Use CancelSelectTextDraw (or whatever the function is called).
__________________
Click banner above for more info. View trailers here.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 22/04/2012, 07:46 PM   #5
2KY
Gangsta
 
2KY's Avatar
 
Join Date: Jan 2012
Location: United States
Posts: 950
Reputation: 166
Default Re: Re-initializing the mouse?

Quote:
Originally Posted by MP2 View Post
You never cancel the TD selection. Use CancelSelectTextDraw (or whatever the function is called).
Thank you. Will test shortly!
__________________
Check out my wiki page
2KY is offline   Reply With Quote
Old 22/04/2012, 08:06 PM   #6
2KY
Gangsta
 
2KY's Avatar
 
Join Date: Jan 2012
Location: United States
Posts: 950
Reputation: 166
Default Re: Re-initializing the mouse?

pawn Code:
case DIALOG_LOGIN:
        {
            if ( response )
            {
                if( !strlen ( inputtext ) )
                    return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Incorrect password!", "You have entered an incorrect password. Please try again!\n\nNot your account? Type \"/q\" and change your name in the SA:MP browser!", "Submit", "Back" );

                if ( udb_hash ( inputtext ) == accInfo [ playerid ] [ Passcode ] )
                {
                    INI_ParseFile( accPath ( playerid ), "LoadAccount_%s", .bExtra = true, .extra = playerid);

                    accLoggedIn [ playerid ] = 1; // They are now 'logged in'!

                    GivePlayerMoney ( playerid, accInfo [ playerid ] [ Cash ] );

                    HideStartupTextdraws( playerid );

                    SetSpawnInfo ( playerid, 255, accInfo [ playerid ] [ Model ], 0, 0, 10.0, 0.0, 4, 1, 24, 999, 31, 100 );
                    SpawnPlayer ( playerid );
                }
                else return ShowPlayerDialog( playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Incorrect password!", "You have entered an incorrect password. Please try again!\n\nNot your account? Type \"/q\" and change your name in the SA:MP browser!", "Submit", "Back" );
            }
            else if ( !response )
            {
                //They hit 'back'
                CancelSelectTextDraw ( playerid );
                SelectTextDraw( playerid, 0xC90411FF );
            }
        }

Not working. :3
__________________
Check out my wiki page
2KY is offline   Reply With Quote
Old 22/04/2012, 08:33 PM   #7
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,219
Reputation: 976
Default Re: Re-initializing the mouse?

Use CancelSelectTextDraw ( playerid ); when you show the dialog.
__________________
Click banner above for more info. View trailers here.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse.... Baboon Scripting Help 7 21/03/2012 06:51 PM
Mouse Bug Win 7 lynxaegon Client Support 10 02/06/2011 09:21 PM
mouse, need help russo666 Everything and Nothing 7 25/03/2010 06:19 PM
Mouse / Cam help Willstah Client Support 4 10/01/2010 12:45 PM


All times are GMT. The time now is 10:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.