Class Dialog Help
#1

Hey, i need some help to create a class dialog.
The dialog have to popup when player's joins.

I want these class: Pilot,Taxi,Helicopter,Army,Police

And score for these class:Pilot 0,Taxi 20,Helicopter 50,Army 130,Police 260

Example: http://i.imgur.com/d9srJad.png?1
But just with my classes

Can anyone make that pm the code if anyone can
Reply
#2

Take this script I hope it's just like you wanted !

pawn Код:
#include a_samp

#define DIALOG_CLASS    (6969)
#define S               "{3399ff}"
#define G               "{6EF83C}"
#define R               "{F81414}"
#define W               "{FFFFFF}"
#define YE              "{FFFF00}"

new gsString[ 1024 ];

public OnPlayerConnect( playerid )
{
    // Show player select dialog
    ShowPlayerFractionDialog( playerid, true );
}

public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case DIALOG_CLASS:
        {
            switch( listitem )
            {
                case 0:
                {
                    // Put here the code for the Pilot Selection
                }
                case 1:
                {
                    if( GetPlayerScore( playerid ) >= 20 )
                    {
                        // Put here the code for the Taxi Selection
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 20 );
                }
                case 2:
                {
                    if( GetPlayerScore( playerid ) >= 50 )
                    {
                        // Put here the code for the Helicopter Selection
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 50 );
                }
                case 3:
                {
                    if( GetPlayerScore( playerid ) >= 130 )
                    {
                        // Put here the code for the Army Selection
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 130 );
                }
                case 4:
                {
                    if( GetPlayerScore( playerid ) >= 260 )
                    {
                        // Put here the code for the Police Selection
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 260 );
                }
            }
        }
    }
    return ( 1 );
}

Class_String( )
{
    gsString[ 0 ] = EOS;
   
    strcat( gsString, ""G"Pilot\t\t 0\n" );
    strcat( gsString, ""G"Taxi\t\t 20\n" );
    strcat( gsString, ""G"Helicopter\t 50\n" );
    strcat( gsString, ""G"Army\t\t 130\n" );
    strcat( gsString, ""G"Police\t\t 260" );
   
    return gsString;
}

stock ShowPlayerFractionDialog( playerid, type, score = 0 )
{
    switch( type )
    {
        case false:
        {
            format( gsString, sizeof( gsString ), ""R"ERROR: "W"You need "YE"%d "W"score to be able to select this Fraction.", score );
            SendClientMessage( playerid, ~1, gsString );
        }
        case true: SendClientMessage( playerid, ~1, ""S"INFO: "W"Please select your "YE"Fraction "W"from the dialog." );
    }
    return ShowPlayerDialog( playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Fraction Menu           \tScore Required", Class_String( ), "(Select)", "" );
}
Reply
#3

Thanks i will try now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)