CMD:atm(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,1,2228.30688477,-1715.81237793,13.21310616)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2045.58654785,-1909.97204590,13.18977451)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,1154.66308594,-1456.00451660,15.43977451)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2424.53173828,-1219.58166504,25.17372131)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,378.54266357,-2061.15917969,7.47883701)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2023.52770996,997.79492188,10.46321201)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2194.95239258,1988.35095215,11.93977451)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2224.72631836,1830.93542480,10.46321201)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2196.88867188,1673.56408691,12.01008701)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,1627.44104004,1814.48828125,10.46321201)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,1971.71301270,2041.84753418,10.70389652)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2275.69873047,2292.50634766,10.46321201)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,2500.02856445,2123.77832031,10.48342609)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,413.86004639,2537.95288086,18.79133606)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,-1967.16564941,291.60144043,34.94517517)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,-2269.99560547,-153.04603577,34.96321106)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,-2517.18969727,-624.90289307,132.43955994)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
else if(!IsPlayerInRangeOfPoint(playerid,1,-2626.94506836,1412.05920410,6.73664951)) return SendClientMessage(playerid,red,"ERROR: You are not near a atm!");
ShowPlayerDialog(playerid,37,DIALOG_STYLE_LIST,"ATM","Deposit\nWithdraw","Open","Close");
return 1;
}
forward IsAtATM(playerid);
public IsAtATM(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,1008.0930,-929.5586,42.3281) || IsPlayerInRangeOfPoint(playerid,2.0,2227.61,-1710.96,13.59) || IsPlayerInRangeOfPoint(playerid,2.0,1929.5021,-1783.4802,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0,2227.61,-1710.96,13.59) || IsPlayerInRangeOfPoint(playerid,8.0,1424.7081,-981.4030,1639.7843))
{//vinwood station & other in gym
return 1;
}
}
return 0;
}
// Thats just an example i took from a GF edit. But just alter the X,Y,Z coordinates to where your ATM's are and add more if you know how to. If not same method as above. Im sure you'll understand. If not post again
if(!IsAtATM(playerid))
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not at an ATM machine !");
return 1;
}
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(137) : error 075: input line too long (after substitutions)
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : error 001: expected token: ",", but found "-rational value-"
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : warning 215: expression has no effect
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : warning 215: expression has no effect
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : warning 215: expression has no effect
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : error 001: expected token: ";", but found ")"
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : warning 217: loose indentation
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : error 029: invalid expression, assumed zero
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\Vercetti.pwn(139) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
|
Rather than doing that why not just make it as a public call, like so:
pawn Code:
pawn Code:
|
forward IsAtAtm
IsAtATM(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0,2065.439453125, -1897.5510253906, 13.19670009613) || IsPlayerInRangeOfPoint(playerid,3.0,1497.7467041016, -1749.8747558594, 15.088212013245) || IsPlayerInRangeOfPoint(playerid,3.0,2093.5124511719, -1359.5474853516, 23.62727355957) || IsPlayerInRangeOfPoint(playerid,3.0,1155.6235351563, -1464.9141845703, 15.44321346283))
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,2139.4487304688, -1164.0811767578, 23.63508605957) || IsPlayerInRangeOfPoint(playerid,3.0,1482.7761230469, -1010.3353881836, 26.48664855957) || IsPlayerInRangeOfPoint(playerid,3.0,1482.7761230469, -1010.3353881836, 26.48664855957) || IsPlayerInRangeOfPoint(playerid,3.0,387.16552734375, -1816.0512695313, 7.4834146499634))
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,-24.385023117065, -92.001075744629, 1003.1897583008) || IsPlayerInRangeOfPoint(playerid,3.0,-31.811220169067, -58.106018066406, 1003.1897583008) || IsPlayerInRangeOfPoint(playerid,3.0,1212.7785644531, 2.451762676239, 1000.5647583008) || IsPlayerInRangeOfPoint(playerid,3.0,2324.4028320313, -1644.9445800781, 14.469946861267))
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,2228.39, -1707.78, 13.25) || IsPlayerInRangeOfPoint(playerid,3.0,651.19305419922, -520.48815917969, 15.978837013245) || IsPlayerInRangeOfPoint(playerid, 3.0, 45.78035736084, -291.80926513672, 1.5024013519287) || IsPlayerInRangeOfPoint(playerid,3.0,1275.7958984375, 368.31481933594, 19.19758605957) || IsPlayerInRangeOfPoint(playerid,3.0,2303.4577636719, -13.539554595947, 26.12727355957))/*End of Red County Random ATM's*/
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,294.80, -84.01, 1001.0) || /*Start of Red County Random ATM's*/IsPlayerInRangeOfPoint(playerid,3.0,691.08215332031, -618.5625, 15.978837013245) || IsPlayerInRangeOfPoint(playerid,3.0,173.23471069336, -155.07606506348, 1.2210245132446) || IsPlayerInRangeOfPoint(playerid,3.0,1260.8796386719, 209.30152893066, 19.19758605957) || IsPlayerInRangeOfPoint(playerid,3.0,2316.1015625, -88.522567749023, 26.12727355957))/*End of Red County Random ATM's*/
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,1311.0361,-1446.2249,0.2216))
{//ATMS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,2052.9246, -1660.6346, 13.1300) || IsPlayerInRangeOfPoint(playerid,3.0,-1980.6300,121.5300,27.3100))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,-2453.7600,754.8200,34.8000) || IsPlayerInRangeOfPoint(playerid,3.0,-2678.6201,-283.3400,6.8000))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,519.8157,-2890.8601,4.4609))
{
return 1;
}
}
return 0;
}
or the command atm