10.06.2017, 17:59
Hello so i created a little bank system in my script, the problem is when i type /withdraw <amount> it not showing a message that i have withdrawn or i don't have that much to withdraw and same thing in /deposit <amount>, and when i /checkbalance it says 0$..
Usiing Y_INI.
PHP код:
CMD:deposit(playerid, params[])
{
new string[256];
new type;
{
if(sscanf(params, "i", type)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/deposit <amount>");
if(type == 0)
if(GetPlayerMoney(playerid) < type)
{
GivePlayerMoney(playerid,-type);
PlayerInfo[playerid][pBankAccount] += type;
format(string, sizeof(string), "[BANK]: {Ffffff}You have successfully deposited {f00f00}$%d {FFFFFF}to your bank account.", type);
SendClientMessage(playerid, 0xf8f8f8fff, string);
}
else SendClientMessage(playerid, 0xf8f8f8fff, "ERROR: {FFFFFF}You do not have that much amount in your hand");
}
return 1;
}
CMD:withdraw(playerid,params[])
{
new string[256];
new type;
{
if(sscanf(params, "i", type)) return SendClientMessage(playerid, 0xf8f8f8fff, "Syntax: {f00f00}/withdraw <amount>");
if(type == 0)
if(PlayerInfo[playerid][pBankAccount] >= type)
{
PlayerInfo[playerid][pBankAccount] -= type;
GivePlayerMoney(playerid, type);
format(string, sizeof(string), "[BANK]: {FFFFFF}You have successfully withdrawn {f00f00}$%d {FFFFFF}from your bank account.", type);
SendClientMessage(playerid, 0xF8f8f8fff, string);
}
else SendClientMessage(playerid, 0xF8f8f8ffF, "ERROR: {FFFFFF}You do not have that much amount in your account");
}
return 1;
}
CMD:checkbalance(playerid,params[])
{
new string[256];
format(string, sizeof(string), "[BANK] {FFFFFF}You currently have $%d In your bank account.", PlayerInfo[playerid][pBankAccount]);
SendClientMessage(playerid,0xf8f8f8fff,string);
return 1;
}