Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ATM STAFF
- if(strcmp(cmd, "/atmwithdraw", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3, -32.276363,-57.995586,1003.139953) || IsPlayerInRangeOfPoint(playerid, 3, 374.718902,167.128982,1007.987304) || IsPlayerInRangeOfPoint(playerid, 3, -1748.5145,15.4453,180.8316) || IsPlayerInRangeOfPoint(playerid, 3, -915.1777,43.0257,97.9856) || IsPlayerInRangeOfPoint(playerid, 3, -931.1852,42.1797,358.6672) || IsPlayerInRangeOfPoint(playerid, 3, -1248.6656,18.3522,203.4427)
- || IsPlayerInRangeOfPoint(playerid, 3, 374.6863,167.7920,1008.3828) || IsPlayerInRangeOfPoint(playerid, 3, 2116.0210,-1117.7926,25.2971))
- {
- SendClientMessage(playerid, COLOR_GREY, " You are not at an ATM!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /atmwithdraw [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, "Koriscenje: /atmwithdraw [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 (cashdeposit > 5000)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " You can only withdraw up to $5000!");
- return 1;
- }
- ConsumingMoney[playerid] = 1;
- SafeGivePlayerMoney(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);
- PlayerInfo[playerid][pJobTimer] = 12;
- GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), " ID(%d) -%s has withdrawn %d from their bank.", playerid,giveplayer,cashdeposit);
- ABroadCast(COLOR_YELLOW,string, 5);
- new y, m, d;
- new h,mi,s;
- getdate(y,m,d);
- gettime(h,mi,s);
- format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /atmwithdraw ($%d)",d,m,y,h,mi,s,sendername, cashdeposit);
- PayLog(string);
- return 1;
- }
- return 1;
- }
- // END ATM STUFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement