31.05.2015, 08:23
Hello, i need help with max cash storage.
Like, making the max house storage to 10m to the players can't store more then 10m in it.
In my case, its wallet. I have maximum storage:25m but still players can store more then 25m by doing it in different way. i need to fix it
Im saving wallet cash using y_Ini.
here's my code
But there's a problem in this code. More then 25m can be stored.
HOW: well it says "You can't" store more then 25m in wallet when someone stores 25m at first attempt
But if some one store 24m first and then 2m, then it will be 26m in wallet.
How can i fix it
Like, making the max house storage to 10m to the players can't store more then 10m in it.
In my case, its wallet. I have maximum storage:25m but still players can store more then 25m by doing it in different way. i need to fix it
Im saving wallet cash using y_Ini.
here's my code
PHP код:
// on player text
if (GetPlayerCash(playerid) < Option)
{
format(string, sizeof(string), "You Don't Have $%d To Put Into Storage.",Option);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
if (Option >= 25000000)
{
SendClientMessage(playerid, COLOR_ERROR, "You Can't Store More Then 25m In Your Wallet.");
return 1;
}
if(wInfo[playerid][MoneyWallet] > 24999999)
{
format(string, sizeof(string), "You Can't Store More Then 25 In Your Wallet.");
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
if(wInfo[playerid][MoneyWallet] < 24999999)
{
GiveCash(playerid, - Option);
wInfo[playerid][MoneyWallet] = wInfo[playerid][MoneyWallet] + Option;
format(string, sizeof(string), "You Have Placed $%d In Storage. Total Wallet Storage: $%d.",Option, wInfo[playerid][MoneyWallet]);
SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, string);
HideTextDrawMenu(playerid);
Wallet_Save(playerid);
Wallet_Load(playerid);
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Can't Store More Then 10m In Your Wallet.");
}
HOW: well it says "You can't" store more then 25m in wallet when someone stores 25m at first attempt
But if some one store 24m first and then 2m, then it will be 26m in wallet.
How can i fix it