21.08.2012, 11:29
When i use the following code, a dialog will show up but no action is being taken. It probably is a minor glitch.
pawn Код:
#include <a_samp>
#define DIALOG_HOME 1
#define FILTERSCRIPT
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/menu", cmdtext, true) == 0)
{
ShowPlayerDialog(playerid, DIALOG_HOME, DIALOG_STYLE_LIST, "Home Menu", "Kill\nHeal\nWeapons\nCars\nTeleport", "Ok", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_HOME)
{
switch(listitem)
{
case 0:{SetPlayerHealth(playerid, 0.0);}
case 1:{SetPlayerHealth(playerid, 100.0); SetPlayerArmour(playerid, 100.0);}
case 2:{SetPlayerHealth(playerid, 0.0);}
case 3:{SetPlayerHealth(playerid, 0.0);}
case 4:{SetPlayerHealth(playerid, 0.0);}
}
}
return 1;
}