OnDialogResponse-2nd response -
NviDa - 20.04.2014
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
Re: OnDialogResponse-2nd response -
Bingo - 20.04.2014
You mean you dont know where to add other dialog responses?
Re: OnDialogResponse-2nd response -
Galletziz - 20.04.2014
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;
}
Re: OnDialogResponse-2nd response -
NviDa - 20.04.2014
Yea.
Re: OnDialogResponse-2nd response -
Galletziz - 20.04.2014
Quote:
Originally Posted by NviDa
Yea.
|
works?
Re: OnDialogResponse-2nd response -
NviDa - 20.04.2014
@Galletziz
What? -_-
Re: OnDialogResponse-2nd response -
Galletziz - 20.04.2014
pawn Код:
#define CAR_DIALOG
#define WEAPONS_DIALOG
if(dialogid == CAR_DIALOG)
{
Switch(listitem)
{
//case: x..
}
}
if(dialogid == WEAPONS_DIALOG)
{
Switch(listitem)
{
//case: x..
}
}