Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/atm", true) == 0)
- {
- if(IsAtGasStation(playerid))
- {
- if(IsPlayerConnected(playerid))
- {
- new x_info[128];
- x_info = strtok(cmdtext, idx);
- new wstring[128];
- if(!strlen(x_info)) {
- format(wstring, sizeof(wstring), " %s ", GetPlayerNameEx(playerid));
- SendClientMessage(playerid, COLOR_WHITE, wstring);
- SendClientMessage(playerid, COLOR_LSPD, "[OPTIONS]");
- SendClientMessage(playerid, COLOR_WHITE, "- WITHDRAW");
- SendClientMessage(playerid, COLOR_WHITE, "- BALANCE");
- SendClientMessage(playerid, COLOR_WHITE, "- ACCOUNT");
- SendClientMessage(playerid, COLOR_LSPD, "ATM MACHINE");
- return 1;
- }
- if(strcmp(x_info, "withdraw", true) == 0)
- {
- if(PlayerInfo[playerid][pSilverBankCard] = 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /atm withdraw [amount]");
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "(USAGE) /atm withdraw [amount]");
- return 1;
- }
- if(PlayerInfo[playerid][pBank] >= cashdeposit)
- {
- GivePlayerCash(playerid,cashdeposit);
- PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
- format(string, sizeof(string), "(INFO) You have withdrawn $%d, new balance: $%d", cashdeposit,PlayerInfo[playerid][pBank]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- PlayerActionMessage(playerid,15.0,"takes the money from the dispenser in the ATM machine");
- OnPlayerDataSave(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "(ERROR) You do not have that much in your bank");
- }
- }
- else if(strcmp(x_info, "balance", true) == 0)
- {
- if(PlayerInfo[playerid][pBronzeBankCard] = 1 || PlayerInfo[playerid][pSilverBankCard] = 1 || PlayerInfo[playerid][pGoldBankCard] = 1)
- {
- format(string, sizeof(string), "BALANCE: $%d", PlayerInfo[playerid][pBank]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- PlayerActionMessage(playerid,15.0,"receives a mini-bank statement from the machine");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "(ERROR) You do not have a bank card");
- }
- }
- else if(strcmp(x_info, "account", true) == 0)
- {
- if(PlayerInfo[playerid][pBronzeBankCard] = 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have a bronze account");
- }
- if(PlayerInfo[playerid][pSilverBankCard] = 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have a silver account");
- }
- if(PlayerInfo[playerid][pGoldBankCard] = 1)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You have a gold account");
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement