Dialog problem. Registration.
#4

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REG:
        {
            if (!response)
            {
                new Str [ 128 ] , Str2 [ 128 ] ;
                format ( Str , 128 , ""#COLOR_RED"» "#COLOR_WHITE"You need to "#COLOR_HIGHGREEN"register "#COLOR_WHITE"on this server in order to play." ) ;
                format ( Str2 , 128 , ""#COLOR_RED"» "#COLOR_WHITE"You have been "#COLOR_RED"KICKED "#COLOR_WHITE"as registration is compulsary." ) ;
                SendClientMessage ( playerid , -1 , Str ) ;
                SendClientMessage ( playerid , -1 , Str2 ) ;
                Kick ( playerid ) ;
                return 1;
            }
            else
            {
                PlayerRegister ( playerid , inputtext ) ;
                new Str [ 128 ] , Str2 [ 128 ] , Str3 [ 128 ] ;
                format ( Str , 128 , ""#COLOR_RED"» "#COLOR_WHITE"Account : "#COLOR_RED"%s "#COLOR_WHITE"has been registered "COLOR_HIGHGREEN"successfully!" , GetName ( playerid ) ) ;
                format ( Str2 , 128 , ""#COLOR_RED"» "#COLOR_DARKBLUE"Thank you "#COLOR_WHITE"for registration! You may proceed by selecting your skin and spawn" ) ;
                format ( Str3 , 128 , ""#COLOR_RED"» "#COLOR_WHITE"%s just regitered their account on the server! "#COLOR_HIGHGREEN"We "COLOR_WHITE"welcome %s behalf of all our members" , GetName ( playerid ) , GetName ( playerid ) ) ;
                SendClientMessage ( playerid , -1 , Str ) ;
                SendClientMessage ( playerid , -1 , Str2 ) ;
                SendClientMessageToAll ( -1 , Str3 ) ;
            }
        }
Quote:
Originally Posted by Alexis1999
Посмотреть сообщение
If Firecat's code doesn't work try.

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_REG:
        {
            if (!
response)
            {
                new 
Str 128 ] , Str2 128 ] ;
                
format Str 128 ""#COLOR_RED"» "#COLOR_WHITE"You need to "#COLOR_HIGHGREEN"register "#COLOR_WHITE"on this server in order to play." ) ;
                
format Str2 128 ""#COLOR_RED"» "#COLOR_WHITE"You have been "#COLOR_RED"KICKED "#COLOR_WHITE"as registration is compulsary." ) ;
                
SendClientMessage playerid , -Str ) ;
                
SendClientMessage playerid , -Str2 ) ;
                
Kick playerid ) ;
            }
            else if (
response)
            {
                
PlayerRegister playerid inputtext ) ;
                new 
Str 128 ] , Str2 128 ] , Str3 128 ] ;
                
format Str 128 ""#COLOR_RED"» "#COLOR_WHITE"Account : "#COLOR_RED"%s "#COLOR_WHITE"has been registered "COLOR_HIGHGREEN"successfully!" , GetName ( playerid ) ) ;
                
format Str2 128 ""#COLOR_RED"» "#COLOR_DARKBLUE"Thank you "#COLOR_WHITE"for registration! You may proceed by selecting your skin and spawn" ) ;
                
format Str3 128 ""#COLOR_RED"» "#COLOR_WHITE"%s just regitered their account on the server! "#COLOR_HIGHGREEN"We "COLOR_WHITE"welcome %s behalf of all our members" , GetName ( playerid ) , GetName ( playerid ) ) ;
                
SendClientMessage playerid , -Str ) ;
                
SendClientMessage playerid , -Str2 ) ;
                
SendClientMessageToAll ( -Str3 ) ;
            }
        } 
How the hell is possible D:

Both code's doesn't seems to be working :/




My whole OnDialogResponse callback:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REG:
        {
            if (!response)
            {
                new Str [ 128 ] , Str2 [ 128 ] ;
                format ( Str , 128 , ""#COLOR_RED"» "#COLOR_WHITE"You need to "#COLOR_HIGHGREEN"register "#COLOR_WHITE"on this server in order to play." ) ;
                format ( Str2 , 128 , ""#COLOR_RED"» "#COLOR_WHITE"You have been "#COLOR_RED"KICKED "#COLOR_WHITE"as registration is compulsary." ) ;
                SendClientMessage ( playerid , -1 , Str ) ;
                SendClientMessage ( playerid , -1 , Str2 ) ;
                Kick ( playerid ) ;
            }
            else if (response)
            {
                PlayerRegister ( playerid , inputtext ) ;
                new Str [ 128 ] , Str2 [ 128 ] , Str3 [ 128 ] ;
                format ( Str , 128 , ""#COLOR_RED"» "#COLOR_WHITE"Account : "#COLOR_RED"%s "#COLOR_WHITE"has been registered "COLOR_HIGHGREEN"successfully!" , GetName ( playerid ) ) ;
                format ( Str2 , 128 , ""#COLOR_RED"» "#COLOR_DARKBLUE"Thank you "#COLOR_WHITE"for registration! You may proceed by selecting your skin and spawn" ) ;
                format ( Str3 , 128 , ""#COLOR_RED"» "#COLOR_WHITE"%s just regitered their account on the server! "#COLOR_HIGHGREEN"We "COLOR_WHITE"welcome %s behalf of all our members" , GetName ( playerid ) , GetName ( playerid ) ) ;
                SendClientMessage ( playerid , -1 , Str ) ;
                SendClientMessage ( playerid , -1 , Str2 ) ;
                SendClientMessageToAll ( -1 , Str3 ) ;
            }
        }
        case DIALOG_LOG:
        {
            if ( !response ) return Kick ( playerid );
            if ( response )
            {
                if ( strlen ( inputtext ) >= 4 && strlen ( inputtext ) <= 35 )
                {
                    PlayerLogin ( playerid , inputtext ) ;
                    PTimer [ playerid ] = SetTimerEx ( "PlayTime" , 1000 , 1 , "i" , playerid ) ;
                }
                else
                {
                    ShowPlayerDialog ( playerid , DIALOG_LOG , DIALOG_STYLE_INPUT , "{FF0000}Password Incorrent {FFFFFF}- {80FF00}Login" , "{FFFFFF}The password enetered was {FF0000}incorrect\n{FFFFFF}Type your password again to login:" , "Login" , "Leave" ) ;
                }
                return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Dialog problem. Registration. - by Ronaldo_raul™ - 26.07.2012, 09:19
Re: Dialog problem. Registration. - by FireCat - 26.07.2012, 10:10
Re: Dialog problem. Registration. - by Alexis1999 - 26.07.2012, 10:17
Re: Dialog problem. Registration. - by Ronaldo_raul™ - 26.07.2012, 10:41
Re: Dialog problem. Registration. - by Vince - 26.07.2012, 10:45
Re: Dialog problem. Registration. - by Ronaldo_raul™ - 26.07.2012, 10:52
Re: Dialog problem. Registration. - by playbox12 - 26.07.2012, 11:06
Re: Dialog problem. Registration. - by Ronaldo_raul™ - 26.07.2012, 11:16
Re: Dialog problem. Registration. - by Ronaldo_raul™ - 26.07.2012, 16:10
Re: Dialog problem. Registration. - by iGetty - 26.07.2012, 16:14

Forum Jump:


Users browsing this thread: 1 Guest(s)