14.02.2011, 16:14
i dont know why but i have a problem with how to see how much i deposited and withdraw... (and see my balance)i try to do it with format and with %s or %d but none of it works!!! .another thing is that when i go to my file to see my amount of money it doesn't show me the right number... i mean sometimes it show me 2506 even that i deposited only 100... plz help!!!
deposit+withdraw+balance commands:
this is on another place...:
deposit+withdraw+balance commands:
pawn Код:
if(dialogid == 5)
{
if(!response){
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
}
if(strlen(inputtext) > 0)
{
new string[128];
new playermoney = GetPlayerMoney(playerid);
new money = strval(inputtext);
new cash = PlayerInfo[playerid][BankMoney] += money;
if(playermoney >= money)
{
GivePlayerMoney(playerid, -money);
format(string, sizeof(string), "You deposited %s cash in your bank account. now you have %s in you bank account", money);
SendClientMessage(playerid, COLOUR_YELLOW, string);
dini_Create(file);
dini_IntSet(file, "Bank Money",cash);
}
else{
SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
}
}
else
{
SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
}
}
if(dialogid == 6){
if(!response){
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
}
if(strlen(inputtext) > 0)
{
new string[128];
new playermoney = GetPlayerMoney(playerid);
new money = strval(inputtext);
new cash = PlayerInfo[playerid][BankMoney] -= money;
if(PlayerInfo[playerid][BankMoney] >= money)
{
dini_IntSet(file, "BankMoney",cash);
GivePlayerMoney(playerid, money);
format(string, sizeof(string), "You withdraw %s from your bank account. now you have %s in you bank account", money, cash);
SendClientMessage(playerid, COLOUR_GREEN, string);
}
else{
SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money on your bank account!!!");
}
}
else{
SendClientMessage(playerid, COLOUR_RED, "You do not have this amount of money!!!");
}
}
pawn Код:
new cash = PlayerInfo[playerid][BankMoney];
SendClientMessage(playerid, COLOUR_YELLOW, "You have on you bank account %s money", cash);