/atm problem
#1

Well when im not near a /atm it shows i am not near a atm, but when i go to a random atm it shows You are not near a atm, please help
pawn Code:
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;
}
Reply
#2

Rather than doing that why not just make it as a public call, like so:

pawn Code:
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
Then under the CMD:atm you should just add

pawn Code:
if(!IsAtATM(playerid))
{
      SendClientMessage(playerid, COLOR_GRAD2, "  You are not at an ATM machine !");
      return 1;
}
Reply
#3

pawn Code:
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.
Reply
#4

bump
Reply
#5

Show us your new code.
Reply
#6

Quote:
Originally Posted by PhoenixB
View Post
Rather than doing that why not just make it as a public call, like so:

pawn Code:
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
Then under the CMD:atm you should just add

pawn Code:
if(!IsAtATM(playerid))
{
      SendClientMessage(playerid, COLOR_GRAD2, "  You are not at an ATM machine !");
      return 1;
}
Bra, Its better this way.

PHP Code:
forward IsAtAtm
IsAtATM
(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInRangeOfPoint(playerid,3.0,2065.439453125, -1897.551025390613.19670009613) ||  IsPlayerInRangeOfPoint(playerid,3.0,1497.7467041016, -1749.874755859415.088212013245) || IsPlayerInRangeOfPoint(playerid,3.0,2093.5124511719, -1359.547485351623.62727355957) || IsPlayerInRangeOfPoint(playerid,3.0,1155.6235351563, -1464.914184570315.44321346283))
        {
//ATMS
            
return 1;
        }
        else if(
IsPlayerInRangeOfPoint(playerid,3.0,2139.4487304688, -1164.081176757823.63508605957) || IsPlayerInRangeOfPoint(playerid,3.0,1482.7761230469, -1010.335388183626.48664855957) || IsPlayerInRangeOfPoint(playerid,3.0,1482.7761230469, -1010.335388183626.48664855957) || IsPlayerInRangeOfPoint(playerid,3.0,387.16552734375, -1816.05126953137.4834146499634))
        {
//ATMS
            
return 1;
        }
        else if(
IsPlayerInRangeOfPoint(playerid,3.0,-24.385023117065, -92.0010757446291003.1897583008) || IsPlayerInRangeOfPoint(playerid,3.0,-31.811220169067, -58.1060180664061003.1897583008) || IsPlayerInRangeOfPoint(playerid,3.0,1212.77856445312.4517626762391000.5647583008) || IsPlayerInRangeOfPoint(playerid,3.0,2324.4028320313, -1644.944580078114.469946861267))
        {
//ATMS
            
return 1;
        }
        else if(
IsPlayerInRangeOfPoint(playerid,3.0,2228.39, -1707.7813.25) || IsPlayerInRangeOfPoint(playerid,3.0,651.19305419922, -520.4881591796915.978837013245) || IsPlayerInRangeOfPoint(playerid3.045.78035736084, -291.809265136721.5024013519287) || IsPlayerInRangeOfPoint(playerid,3.0,1275.7958984375368.3148193359419.19758605957) || IsPlayerInRangeOfPoint(playerid,3.0,2303.4577636719, -13.53955459594726.12727355957))/*End of Red County Random ATM's*/
        
{//ATMS
            
return 1;
        }
        else if(
IsPlayerInRangeOfPoint(playerid,3.0,294.80, -84.011001.0) || /*Start of Red County Random ATM's*/IsPlayerInRangeOfPoint(playerid,3.0,691.08215332031, -618.562515.978837013245) || IsPlayerInRangeOfPoint(playerid,3.0,173.23471069336, -155.076065063481.2210245132446) || IsPlayerInRangeOfPoint(playerid,3.0,1260.8796386719209.3015289306619.19758605957) || IsPlayerInRangeOfPoint(playerid,3.0,2316.1015625, -88.52256774902326.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.634613.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;

Reply
#7

add that in public IsInAtm or the command atm
Reply
#8

Quote:
Originally Posted by Tanush123
View Post
add that in public IsInAtm or the command atm
Public ofc.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)