03.12.2012, 21:13
Okay I got this So far it works but producing $210.000000 How do I make it show just $210
So I can Then Store the Price and The Ammo in a Varible So i can
GivePlayerWeapon(playerid,Wepid,bammo); and GivePlayerMoney(playerid, -tcost);
So I can Then Store the Price and The Ammo in a Varible So i can
GivePlayerWeapon(playerid,Wepid,bammo); and GivePlayerMoney(playerid, -tcost);
pawn Код:
if(dialogid == DIALOG_9MMAMMO)
{
if(!response)
{
SendClientMessage(playerid, ORANGE, "Okay You Choosen Not To Purchase ");
TogglePlayerControllable(playerid,1);
}
else
{
new total[128],Float:money,str[80];
new ammo=strval(inputtext);
if(!strval(inputtext)) return SendClientMessage(playerid, RED, "Error Numbers Only ");
if(ammo < 1 || ammo > 10000) return SendClientMessage(playerid, ORANGE, "Ammo ammount 1 Thru 10000");
money=ammo*0.80+50;
format(str,sizeof(str),"%f ",money);
format(total,sizeof(total), "9mm $50 \n Ammo $0.80 \nGrand Total $%s", str);
ShowPlayerDialog(playerid, DIALOG_CONFIRM, DIALOG_STYLE_PASSWORD, "Confirm Purchase",total, "Purchase", "Cancel");
}
}
if(dialogid == DIALOG_CONFIRM)
{
if(!response)
{
SendClientMessage(playerid, ORANGE, "Okay You Choosen Not To Purchase ");
TogglePlayerControllable(playerid,1);
}
else
{
GivePlayerWeapon(playerid,Wepid,bammo);
GivePlayerMoney(playerid, -tcost);
}
}