22.11.2014, 08:15
I just wanna' know if you can use else under OnDialogResponse, like this:
Will work, if player doesn't have 10, 15, 30 experience, will get message from else?
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CHOOSE)
{
if(response)
{
if(listitem == 0)
{
ClassInfo[playerid][Normal] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FF0000}Jucator {15FF00} in echipa Romaniei !");
}
if(listitem == 1)
{
if(ClassInfo[playerid][Experienta] >= 10)
{
ClassInfo[playerid][Normal] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FFCC33}Sniper {15FF00} in echipa Romaniei !");
}
else
{
SendClientMessage(playerid, -1, "{FFCC33}Ne pare rau. Nu ai experienta necesara !");
}
}
if(listitem == 2)
{
if(ClassInfo[playerid][Experienta] >= 15)
{
ClassInfo[playerid][Assault] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FF0000}Assault {15FF00} in echipa Romaniei !");
}
else
{
SendClientMessage(playerid, -1, "{FFCC33}Ne pare rau. Nu ai experienta necesara !");
}
if(listitem == 3)
{
if(ClassInfo[playerid][Experienta] >= 30)
{
ClassInfo[playerid][Killer] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FF0000}KILLER {15FF00} in echipa Romaniei !");
}
}
else
{
SendClientMessage(playerid, -1, "{FFCC33}Ne pare rau. Nu ai experienta necesara !");
}
if(listitem == 4)
{
if(ClassInfo[playerid][VIPP] >= 1)
{
ClassInfo[playerid][Killer] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FF0000}VIP {15FF00} in echipa Romaniei !");
}
}
else
{
SendClientMessage(playerid, -1, "{FFCC33}Ne pare rau. Nu ai experienta necesara !");
}
if(listitem == 5)
{
if(ClassInfo[playerid][Donator] >= 1)
{
ClassInfo[playerid][Killer] = 1;
SendClientMessage(playerid, -1, "{FFCC33}COD: {15FF00}Ti-ai ales cu succes rank-ul de {FF0000}Donator {15FF00} in echipa Romaniei !");
}
}
else
{
SendClientMessage(playerid, -1, "{FFCC33}Ne pare rau. Nu ai experienta necesara !");
}
}
}
}
return 1;
}