Help me with input code to my gm
#1

Hello
Can anyone pull this code into my gm?

Code you have to put in my gm:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 
{
	if(dialogid == DIALOG_ID_TELEPORT)
	{
		switch(listitem)
		{
			case 0:
			{
				SetPlayerPos(playerid,posx,posy,posz);
				SendClientMessage(playerid,-1,"TPed to Option 1!");
			}
			case 1:
			{
				SetPlayerPos(playerid,posx,posy,posz);
				SendClientMessage(playerid,-1,"TPed to Option 2!");
			}
			case 2:
			{
				SetPlayerPos(playerid,posx,posy,posz);
				SendClientMessage(playerid,-1,"TPed to Option 3!");
			}
		}
	}
	return 1;
}
Pull it in here

Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case DIALOG_CLASS:
        {
            switch( listitem )
            {
                case 0:
                {
                    SetSpawnInfo(playerid, 0, 61, 1321.6466, 1266.3080, 10.8203, 1.5767, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                }
                case 1:
                {
                    if( GetPlayerScore( playerid ) >= 20 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 20 );
                }
                case 2:
                {
                    if( GetPlayerScore( playerid ) >= 50 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 50 );
                }
                case 3:
                {
                    if( GetPlayerScore( playerid ) >= 130 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 130 );
                }
                case 4:
                {
                    if( GetPlayerScore( playerid ) >= 260 )
                    {
                        //comming
                    }
                    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 Class.", score );
            SendClientMessage( playerid, ~1, gsString );
        }
        case true: SendClientMessage( playerid, ~1, ""S"INFO: "W"Please select your "YE"Class "W"from the dialog." );
    }
    return ShowPlayerDialog( playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Class Menu          \tScore Required", Class_String( ), "Select", "" );
}
Reply
#2

pawn Код:
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( dialogid )
    {
        case DIALOG_ID_TELEPORT:
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerPos(playerid,posx,posy,posz);
                    SendClientMessage(playerid,-1,"TPed to Option 1!");
                }
                case 1:
                {
                    SetPlayerPos(playerid,posx,posy,posz);
                    SendClientMessage(playerid,-1,"TPed to Option 2!");
                }
                case 2:
                {
                    SetPlayerPos(playerid,posx,posy,posz);
                    SendClientMessage(playerid,-1,"TPed to Option 3!");
                }
            }
        }
        case DIALOG_CLASS:
        {
            switch( listitem )
            {
                case 0:
                {
                    SetSpawnInfo(playerid, 0, 61, 1321.6466, 1266.3080, 10.8203, 1.5767, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                }
                case 1:
                {
                    if( GetPlayerScore( playerid ) >= 20 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 20 );
                }
                case 2:
                {
                    if( GetPlayerScore( playerid ) >= 50 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 50 );
                }
                case 3:
                {
                    if( GetPlayerScore( playerid ) >= 130 )
                    {
                        //comming
                    }
                    else return ShowPlayerFractionDialog( playerid, false, 130 );
                }
                case 4:
                {
                    if( GetPlayerScore( playerid ) >= 260 )
                    {
                        //comming
                    }
                    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 Class.", score );
            SendClientMessage( playerid, ~1, gsString );
        }
        case true: SendClientMessage( playerid, ~1, ""S"INFO: "W"Please select your "YE"Class "W"from the dialog." );
    }
    return ShowPlayerDialog( playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Class Menu          \tScore Required", Class_String( ), "Select", "" );
}
there ya go.
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)