24.10.2014, 11:42
Quote:
You need to combine the two callbacks so you only use it once. Alternatively, use y_dialog so you don't need to worry about that callback as you can just use inlines instead.
|
EDIT: Is it important to return on OnDialogResponse?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RULES)
{
if(response) // If they clicked 'Yes' or pressed enter
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!");
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
if(dialogid==WEAP_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0:SellWeapon(playerid,500,23,250);
case 1:SellWeapon(playerid,650,24,50);
case 2:SellWeapon(playerid,2700,25,50);
case 3:SellWeapon(playerid,3000,26,50);
case 4:SellWeapon(playerid,3000,27,50);
case 5:SellWeapon(playerid,1500,29,500);
case 6:SellWeapon(playerid,2500,30,500);
case 7:SellWeapon(playerid,3100,31,500);
case 8:SellWeapon(playerid,2750,33,50);
case 9:SellWeapon(playerid,4750,34,50);
}
}
return 1;
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}