public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==753 && response)
{
ShowPlayerDialog(playerid, 754, DIALOG_STYLE_LIST, "What would you like to do?","Sell this item I'm holding\nTrade this item for a new item\nPawn this item\nDonate this item\nBrowse what's for sale\nHelp and Info", "Continue", "Leave");
return 1;
}
if(dialogid==754 && response)
{
switch(listitem)
{
case 0:
{
return 1;
}
case 1:
{
return 1;
}
case 2:
{
return 1;
}
case 3:
{
ShowPlayerDialog(playerid, 770, DIALOG_STYLE_MSGBOX, "Donating your weapon...","Are you sure you want to donate this?","Yes","No");
return 1;
}
case 4:
{
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
if (Hour==22)
{
new stor;
stor=random(4);
return 1;
}
if (stor==0)
{
ShowPlayerDialog(playerid, 762, DIALOG_STYLE_LIST, "What would you like to purchase?","Stuff", "Continue", "Leave");
return 1;
}
else if (stor==1)
{
ShowPlayerDialog(playerid, 763, DIALOG_STYLE_LIST, "What would you like to purchase?","Stuff2", "Continue", "Leave");
return 1;
}
else if (stor==2)
{
ShowPlayerDialog(playerid, 764, DIALOG_STYLE_LIST, "What would you like to purchase?","Stuff3", "Continue", "Leave");
return 1;
}
else if (stor==3)
{
ShowPlayerDialog(playerid, 765, DIALOG_STYLE_LIST, "What would you like to purchase?","Stuff4", "Continue", "Leave");
return 1;
}
else if (stor==4)
{
ShowPlayerDialog(playerid, 766, DIALOG_STYLE_LIST, "What would you like to purchase?","Stuff5", "Continue", "Leave");
return 1;
}
else
{
ShowPlayerDialog(playerid, 767, DIALOG_STYLE_MSGBOX, "Inventory is empty...","There is nothing for sale right now, please come back after 22:00.","Continue", "Leave");
return 1;
}
}
if (Hour==22)
{
new stor;
stor=random(4);
//return 1;
}
It's because you returned after checking the hour
Try it without the return. pawn Код:
|
C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(123) : warning 204: symbol is assigned a value that is never used: "stor" C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(123 -- 125) : error 017: undefined symbol "stor" C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(130) : error 017: undefined symbol "stor" C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(135) : error 017: undefined symbol "stor" C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(140) : error 017: undefined symbol "stor" C:\Users\Aerotactics' PC\Desktop\SAMP\filterscripts\PawnShop.pwn(145) : error 017: undefined symbol "stor" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase |
case 4: { new stor; new Hour, Minute, Second; gettime(Hour, Minute, Second); if (Hour==22) { stor=random(4); }
You want to fix the errors, or the way to change the value of the variable only if are the 22h?
Anyway, you should declare "new stor" up Код:
case 4: { new stor; new Hour, Minute, Second; gettime(Hour, Minute, Second); if (Hour==22) { stor=random(4); } |