OnDialogResponse-2nd response
#1

Hi!
I have created a spawn car system(dialog) and made its response on 'OnDialogResponse'.
But now I have problem in putting the code of responses to other dialogs.
Spawn car system dialog response:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
        {
                if(response == 1)
                {
                   if(listitem == 0)
                        {
                            new Float:x, Float:y, Float:z, Float:a;
                            GetPlayerPos(playerid, x,y,z);
                            GetPlayerFacingAngle(playerid, a);
                            new vehicleid = CreateVehicle(411, x+3,y,z, a, -1, -1, -1);
                            PutPlayerInVehicle(playerid, vehicleid, 0);
                         }
                         if(listitem == 1)
                           {
                             new Float:x, Float:y, Float:z, Float:a;
                            GetPlayerPos(playerid, x,y,z);
                            GetPlayerFacingAngle(playerid, a);
                            new vehicleid = CreateVehicle(562, x+3,y,z, a, -1, -1, -1);
                            PutPlayerInVehicle(playerid, vehicleid, 0);

                         }
                        if(listitem == 2)
                           {
                               new Float:x, Float:y, Float:z, Float:a;
                               GetPlayerPos(playerid, x,y,z);
                               GetPlayerFacingAngle(playerid, a);
                               new vehicleid = CreateVehicle(451, x+3,y,z, a, -1, -1, -1);
                               PutPlayerInVehicle(playerid, vehicleid, 0);
                           }
                             
                }
        }
    return 1;
}
How do I add a response to /weapons dialog ?Don't know where to add it lol :P
Reply
#2

You mean you dont know where to add other dialog responses?
Reply
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
        {
                if(response == 1)
                {
                   switch(listitem)
                   {
                      case: 0
                      {
                            new Float:x, Float:y, Float:z, Float:a;
                            GetPlayerPos(playerid, x,y,z);
                            GetPlayerFacingAngle(playerid, a);
                            new vehicleid = CreateVehicle(411, x+3,y,z, a, -1, -1, -1);
                            PutPlayerInVehicle(playerid, vehicleid, 0);
                       }
                       case: 1
                       {
                             new Float:x, Float:y, Float:z, Float:a;
                            GetPlayerPos(playerid, x,y,z);
                            GetPlayerFacingAngle(playerid, a);
                            new vehicleid = CreateVehicle(562, x+3,y,z, a, -1, -1, -1);
                            PutPlayerInVehicle(playerid, vehicleid, 0);

                        }
                       case: 2
                       {
                               new Float:x, Float:y, Float:z, Float:a;
                               GetPlayerPos(playerid, x,y,z);
                               GetPlayerFacingAngle(playerid, a);
                               new vehicleid = CreateVehicle(451, x+3,y,z, a, -1, -1, -1);
                               PutPlayerInVehicle(playerid, vehicleid, 0);
                       }
                             
                  }
              }
         }
    return 1;
}
Reply
#4

Yea.
Reply
#5

Quote:
Originally Posted by NviDa
Посмотреть сообщение
Yea.
works?
Reply
#6

@Galletziz
What? -_-
Reply
#7

pawn Код:
#define CAR_DIALOG
#define WEAPONS_DIALOG

if(dialogid == CAR_DIALOG)
{
     Switch(listitem)
     {
        //case: x..
     }
}

if(dialogid == WEAPONS_DIALOG)
{
     Switch(listitem)
     {
        //case: x..
     }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)