Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/deposit", true) == 0)
- {
- if (IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposit [amount]");
- format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposit [amount]");
- format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- if (cashdeposit > GetPlayerPCash(playerid) || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
- return 1;
- }
- if (PlayerToPoint(25.0, playerid, 2308.5071,-14.6699,26.7422))
- {
- GivePlayerPCash(playerid,-cashdeposit);
- new curfunds = PlayerInfo[playerid][pAccount];
- PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
- SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
- SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Bank Statement: ");
- format(string, sizeof(string), "[INFO]: Old Balance: $%d | New Balance: $%d",curfunds, PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
- format(string, sizeof(string), "[INFO]: Deposit: $%d",cashdeposit);
- SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
- SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
- OnPlayerDataSave(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You are to far from a Bank");
- return 1;
- }
- }
- }
- if(strcmp(cmd, "/withdraw", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
- format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
- format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
- return 1;
- }
- if (PlayerToPoint(25.0, playerid, 2308.5071,-14.6699,26.7422) || IsAtATM(playerid))
- {
- GivePlayerPCash(playerid,cashdeposit);
- PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
- format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- OnPlayerDataSave(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You are to far from a Bank");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement