07.11.2010, 23:08
I made a dialog that works but it just doesn't take the players money from them when they buy it.
pawn Код:
if(dialogid == 6 && response)//if your using only one dialog this isn't needed but you never know.
{
switch(listitem)//wich listitem is chosen
{
case 0:
{
Snack[playerid] = 1;
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, red, "You need $100 to buy a snack.");
if(GetPlayerMoney(playerid) > 100) return SendClientMessage(playerid, green, "You have bought a snack. Use /eatsnack to use it at any time.");
if(Snack[playerid] == 1) return SendClientMessage(playerid, red, "You already have a snack.");
GivePlayerMoney(playerid, -100);
GetPlayerName(playerid, pname, 24);
format(file,sizeof(file),USER_FILES, pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Snack",Snack[playerid] = 1);
}
}
}
}