27.05.2011, 18:57
PHP Code:
#define kCores 655
public OnPlayerCommandText( playerid, cmdtext[] )
{
if( !strcmp( cmdtext, "/mudarcor", true ) ) return ShowPlayerDialog( playerid, kCores, DIALOG_STYLE_LIST, "Roxo\nVermelho\nAzul\nAmarelo\nLaranja\nVerde\nBranco", "Escolher", "Cancelar" ); //Aqui acaba o comando
return false;
}
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
{
if( dialogid == kCores )
{
if( !response ) return SendClientMessage( plauerid, 0xFFF000AA, "Vocк cancelou!" );
if( listitem == 0 ) return SetPlayerColor( playerid, 0x400080AA ); //Roxo
else if( listitem == 1 ) return SetPlayerColor( playerid, 0xFF0000AA ); //Vermelho
else if( listitem == 2 ) return SetPlayerColor( playerid, 0x0000FFAA ); //Azul
else if( listitem == 3 ) return SetPlayerColor( playerid, 0xFFFF00AA ); //Amarelo
else if( listitem == 4 ) return SetPlayerColor( playerid, 0xFF8000AA ); //Laranja
else if( listitem == 5 ) return SetPlayerColor( playerid, 0x008000AA ); //Verde
else if( listitem == 6 ) return SetPlayerColor( playerid, 0xFFFFFFAA ); //Branco
}
return false;
}