Question about checking
#1

Hey, I'd like to ask, how can I subtract money of player for item which player chosen in 59 dialog. Script:

Код:
new const PriceOfItem[] = { 250,450,624,781,944 };

In the other dialog are 6 listitem with Items and timer: SetTimerEx("buy",10000,false,"dd",playerid,PriceOfItem[listitem-1]);

forward buy(playerid,itemprice);
public buy(playerid,itemprice)
{
    new string[126];
    format(string,122,"Are you sure?\n\nThe item price is - {FFFF00}%d $.",itemprice);
    ShowPlayerDialog(playerid,59,DIALOG_STYLE_MSGBOX,"Item price",string,"Buy","Back");
}
Reply
#2

Код:
else if(dialogid == 59)
{
	if(response)
	{
	    GivePlayerMoney(playerid, -(How can I check price?250,450,624,781 or 944))
	}
	return 1;	
}
Reply
#3

Up..
Reply
#4

pawn Код:
new Money;

forward buy(playerid,itemprice);
public buy(playerid,itemprice)
{
    new string[126];
    format(string,122,"Are you sure?\n\nThe item price is - {FFFF00}%d $.",itemprice);
    Money = itemprice;
    ShowPlayerDialog(playerid,59,DIALOG_STYLE_MSGBOX,"Item price",string,"Buy","Back");
}

else if(dialogid == 59)
{
    if(response)
    {
        GivePlayerMoney(playerid, Money);
    }
    return 1;  
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)