SA-MP Forums Archive
Dialog Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog Help (/showthread.php?tid=195556)



Dialog Help - Jacob_Venturas - 03.12.2010

Can someone show me how to use input text style dialogs to find a player and store them in a variable.


Re: Dialog Help - Jacob_Venturas - 03.12.2010

wooooooow


Re: Dialog Help - Retardedwolf - 03.12.2010

pawn Код:
#include <a_samp>
#include <sscanf2>

#define referDialog ( 13245 )

public OnPlayerConnect ( playerid )
{
    ShowPlayerDialog ( playerid, referDialog, DIALOG_STYLE_INPUT, "Referal?", "Did anyone refer you here?", "There", "Nah" );
    return 1;
}

public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext [ ] )
{
    new
        rPlayer
    ;

    switch ( dialogid )
    {
        case referDialog:
        {
            if ( sscanf ( inputtext, "u", rPlayer ) ) ShowPlayerDialog ( playerid, referDialog, DIALOG_STYLE_INPUT, "Referal?", "Did anyone refer you here ?\n[ Please input someone ]", "There", "Nah" );
            else if ( rPlayer == INVALID_PLAYER_ID ) ShowPlayerDialog ( playerid, referDialog, DIALOG_STYLE_INPUT, "Referal?", "Did anyone refer you here ?\n[ Invalid player ]", "There", "Nah" );
            else
            {
                GivePlayerMoney ( rPlayer, 1337 );
                SendClientMessage ( playerid, 0xFFFFFFAA, "Thanks for referring someone." );
            }
        }
    }
    return 1;
}



Re: Dialog Help - JamesC - 03.12.2010

pawn Код:
new Player;
   
    if( !sscanf( inputtext, "u", Player ) )
    {
       
    }
    else
    {
        SendClientMessage( playerid, 0xFFFFFFFF, "Invalid Player ID." );
    }



Re: Dialog Help - Jacob_Venturas - 03.12.2010

Thank you all so much! I will research sscanf.