Dialog problem -
nastoe - 04.02.2010
ok this is dialogs
Код:
if(!strcmp(cmdtext, "/ducan", true))
{
SendClientMessageToAll(0x33AA33AA, "Netko je napisao /ducan");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Ducan Kristijan Stipić", "\nDroga ($500) \nHelti ($500) \nPancirka ($250) \n+1 Score ($10.000)", "Kupi", "Odustani");
return 1;
}
if(!strcmp(cmdtext, "/web", true))
{
SendClientMessageToAll(0x33AA33AA, "Netko je napisao /web");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Skripter ExtremePower vise na /info", "\nwww.royal-gaming.net sve korisne informacije o serveru i svjeze novosti!", "Ok", "Odustani");
return 1;
}
there is dialogid 1 and dialogid2 my problem is when i make example
Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Ducan Kristijan Stipić", "\nDroga ($500) \nHelti ($500) \nPancirka ($250) \n+1 Score ($10.000)", "Kupi", "Odustani");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -500);
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
SendClientMessage(playerid,0xFFFFFF,"Sada si nadrogiran, snaga ti je pala na 50 posto budi oprezan, opljackao si ducan za 50$.");
SetPlayerHealth(playerid, 50);
GivePlayerMoney(playerid, 50);
SetPlayerDrunkLevel (playerid, 5000);
}
case 1:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid,0xFFFFFF,"Kupio si helte za 500$");
SetPlayerHealth(playerid, 100);
}
case 2:
{
if(GetPlayerMoney(playerid) < 250) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid,0xFFFFFF,"Kupio si pancirku za $250");
SetPlayerArmour(playerid, 100);
}
case 3:
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid,0xFFFFFF,"Kupio si score za 10.000");
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
}
}
return 1;
}
how to make OnDialogResponse for dialogid 2 example 2
Код:
if(dialogid == 1 && response)
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1 && response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -500);
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
SendClientMessage(playerid,0xFFFFFF,"Sada si nadrogiran, snaga ti je pala na 50 posto budi oprezan, opljackao si ducan za 50$.");
SetPlayerHealth(playerid, 50);
GivePlayerMoney(playerid, 50);
SetPlayerDrunkLevel (playerid, 5000);
}
case 1:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid,0xFFFFFF,"Kupio si helte za 500$");
SetPlayerHealth(playerid, 100);
}
case 2:
{
if(GetPlayerMoney(playerid) < 250) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid,0xFFFFFF,"Kupio si pancirku za $250");
SetPlayerArmour(playerid, 100);
}
case 3:
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid,0xFFFFFF,"Kupio si score za 10.000");
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
if(dialogid == 2 && response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, 0xFFFFFF, "Nemas dosta novaca.");
GivePlayerMoney(playerid, -500);
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
SendClientMessage(playerid,0xFFFFFF,"Sada si nadrogiran, snaga ti je pala na 50 posto budi oprezan, opljackao si ducan za 50$.");
SetPlayerHealth(playerid, 50);
GivePlayerMoney(playerid, 50);
SetPlayerDrunkLevel (playerid, 5000);
}
}
}
return 1;
}
when i press F5 i get errors my final question is how to make dialog for two commands
Код:
if(!strcmp(cmdtext, "/ducan", true))
{
SendClientMessageToAll(0x33AA33AA, "Netko je napisao /ducan");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Ducan Kristijan Stipić", "\nDroga ($500) \nHelti ($500) \nPancirka ($250) \n+1 Score ($10.000)", "Kupi", "Odustani");
return 1;
}
if(!strcmp(cmdtext, "/web", true))
{
SendClientMessageToAll(0x33AA33AA, "Netko je napisao /web");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Skripter ExtremePower vise na /info", "\nwww.royal-gaming.net sve korisne informacije o serveru i svjeze novosti!", "Ok", "Odustani");
return 1;
}
and make OnDialogResponse for dialogid 1 and dialogid 2
Re: Dialog problem -
s0nic - 04.02.2010
I somewhat get what your trying to say..
Try this?
pawn Код:
if(dialogid == 1 || dialogid == 2 && response)