[Ajuda] Comando em Dialog
#1

Galera eu sou novo aqui no forum samp,e preciso de ajuda para fazer dialog de um comando...Ficarei grato ae qm ajuda =) (OBs: Vo da Reputaзгo)


Precisava de um dialog que digite /equipes e apareзa as opзхes...precisava para esse comando

if(strcmp(cmdtext, "/policia", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s Virou Policial Para Ajudar Os Policias Combater o Trafico - {FF0000}/policia", pname);
SendClientMessageToAll(0xDAA520AA, string);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 280);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2359.9919,-657.7130,128.2075);
SetPlayerFacingAngle(playerid,309.7916);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);

return 1;

}
if(strcmp(cmdtext, "/traficante", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s Virou Traficante Para Ajudar No Trafico De Drogas - {FF0000}/traficante", pname);
SendClientMessageToAll(0xDAA520AA, string);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 109);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2163.9841,-1002.3159,62.7947);
SetPlayerFacingAngle(playerid,232.710;
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);

return 1;
Reply
#2

pawn Код:
if(strcmp(cmdtext,"/equipes",true)==0)
{
    ShowPlayerDialog(playerid, 4656, DIALOG_STYLE_LIST, "Equipes:", "[1] - Policiais.\n[2] - Traficantes.\n", "Selecionar", "Fechar");
    return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 4656) {
        if(response) {
            if(listitem == 0) {
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
                format(string, sizeof(string), "%s Virou Policial Para Ajudar Os Policias Combater o Trafico - {FF0000}/policia", pname);
                SendClientMessageToAll(0xDAA520AA, string);
                ResetPlayerWeapons(playerid);
                SetPlayerSkin(playerid, 280);
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,2359.9919,-657.7130,128.2075);
                SetPlayerFacingAngle(playerid,309.7916);
                SetPlayerArmour(playerid, 100.0);
                SetPlayerHealth(playerid, 100.0);
                return 1;
            }
            if(listitem == 1) {
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
                format(string, sizeof(string), "%s Virou Traficante Para Ajudar No Trafico De Drogas - {FF0000}/traficante", pname);
                SendClientMessageToAll(0xDAA520AA, string);
                ResetPlayerWeapons(playerid);
                SetPlayerSkin(playerid, 109);
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,2163.9841,-1002.3159,62.7947);
                SetPlayerFacingAngle(playerid,232.710;
                SetPlayerArmour(playerid, 100.0);
                SetPlayerHealth(playerid, 100.0);
                return 1;
            }
        }
    }
}
Reply
#3

ve assim:

pawn Код:
//onplayercommandtext

if(strcmp(cmdtext, "/equipes", true) == 0)
{
     ShowPlayerDialog(playerid, 98, DIALOG_STYLE_LIST, "Escolha uma Equipe!", "Policia\nTraficante", "Escolher", "Fechar");
     return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(dialogid == 98)
     {
          if(response)
          {
               if(listitem == 0)
               {
                    OnPlayerCommandText(playerid, "/policia");
                    return 1;
               }
               if(listitem == 1)
               {
                    OnPlayerCommandText(playerid, "/traficante");
                    return 1;
               }
          }
     }
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)