[HELP]ATM PROBLEM
#1

what is problem with this script? I can withdraw money where ever I Want

help plss

Код:
if(strcmp(cmd, "/atmwithdraw", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1034.45593262,-1024.63781738,31.74446106))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1210.35656738,-916.02075195,42.67547607))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1834.03784180,-1851.03039551,13.03264713))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1286.09313965,-1662.60424805,13.18977451))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1027.52441406,-946.51159668,42.25454712))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1307.07653809,328.18820190,19.19758606))
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1381.05981445,259.62057495,19.20983124))
	        {
             SendClientMessage(playerid, SIVA, "   Niste blizu Bankomata !");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, CRVENA, "Komanda: /atmwithdraw [kolicina]");
				format(string, sizeof(string), "  Na Racunu imate: $%d", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			new cashdeposit = strvalEx(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, CRVENA, "Komanda: /atmwithdraw [kolicina]");
				format(string, sizeof(string), "  Na Racunu ima te: $%d", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, ZUTA, string);
				return 1;
			}
			if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
			{
				SendClientMessage(playerid, CRVENA, "  Nemate toliko puno Novaca !");
				return 1;
			}
		    ConsumingMoney[playerid] = 1;
			JB_GivePlayerMoney(playerid,cashdeposit);
			PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
			format(string, sizeof(string), "  Vi ste podigli $%d sa svoga racuna Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, ZUTA, string);
			return 1;
		}
		return 1;
	}
Reply
#2

Use || into a large ( )
Reply
#3

U mean like this??

Код:
if(strcmp(cmd, "/atmwithdraw", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1034.45593262,-1024.63781738,31.74446106)) || 
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1210.35656738,-916.02075195,42.67547607)) ||
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1834.03784180,-1851.03039551,13.03264713)) ||
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1286.09313965,-1662.60424805,13.18977451)) ||
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1027.52441406,-946.51159668,42.25454712)) ||
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1307.07653809,328.18820190,19.19758606)) ||
           if(IsPlayerInRangeOfPoint(playerid, 6.0, 1381.05981445,259.62057495,19.20983124))
	        {
             SendClientMessage(playerid, SIVA, "   Niste blizu Bankomata !");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, CRVENA, "Komanda: /atmwithdraw [kolicina]");
				format(string, sizeof(string), "  Na Racunu imate: $%d", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_GRAD3, string);
				return 1;
			}
			new cashdeposit = strvalEx(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, CRVENA, "Komanda: /atmwithdraw [kolicina]");
				format(string, sizeof(string), "  Na Racunu ima te: $%d", PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, ZUTA, string);
				return 1;
			}
			if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
			{
				SendClientMessage(playerid, CRVENA, "  Nemate toliko puno Novaca !");
				return 1;
			}
		    ConsumingMoney[playerid] = 1;
			JB_GivePlayerMoney(playerid,cashdeposit);
			PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
			format(string, sizeof(string), "  Vi ste podigli $%d sa svoga racuna Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
			SendClientMessage(playerid, ZUTA, string);
			return 1;
		}
		return 1;
	}
Reply
#4

Yes.
Reply
#5

No, he means like this:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 6.0, 1034.45593262,-1024.63781738,31.74446106) || IsPlayerInRangeOfPoint(playerid, 6.0, 1210.35656738,-916.02075195,42.67547607) || IsPlayerInRangeOfPoint(playerid, 6.0, 1834.03784180,-1851.03039551,13.03264713) || IsPlayerInRangeOfPoint(playerid, 6.0, 1286.09313965,-1662.60424805,13.18977451) || IsPlayerInRangeOfPoint(playerid, 6.0, 1027.52441406,-946.51159668,42.25454712) || IsPlayerInRangeOfPoint(playerid, 6.0, 1307.07653809,328.18820190,19.19758606) || IsPlayerInRangeOfPoint(playerid, 6.0, 1381.05981445,259.62057495,19.20983124))
Quote:
Originally Posted by k3nw00d_kri5ty
Посмотреть сообщение
Yes.
Reply
#6

Quote:
Originally Posted by Alby Fire
Посмотреть сообщение
No, he means like this:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 6.0, 1034.45593262,-1024.63781738,31.74446106) || IsPlayerInRangeOfPoint(playerid, 6.0, 1210.35656738,-916.02075195,42.67547607) || IsPlayerInRangeOfPoint(playerid, 6.0, 1834.03784180,-1851.03039551,13.03264713) || IsPlayerInRangeOfPoint(playerid, 6.0, 1286.09313965,-1662.60424805,13.18977451) || IsPlayerInRangeOfPoint(playerid, 6.0, 1027.52441406,-946.51159668,42.25454712) || IsPlayerInRangeOfPoint(playerid, 6.0, 1307.07653809,328.18820190,19.19758606) || IsPlayerInRangeOfPoint(playerid, 6.0, 1381.05981445,259.62057495,19.20983124))


it give me this errors :

C:\Users\Gangasta300\Desktop\Cyb3r RolePlay [0.3c]\gamemodes\CYBER.pwn(35201) : error 075: input line too long (after substitutions)
C:\Users\Gangasta300\Desktop\Cyb3r RolePlay [0.3c]\gamemodes\CYBER.pwn(35202) : error 017: undefined symbol "Is"
C:\Users\Gangasta300\Desktop\Cyb3r RolePlay [0.3c]\gamemodes\CYBER.pwn(35203) : error 017: undefined symbol "PlayerInRangeOfPoint"
C:\Users\Gangasta300\Desktop\Cyb3r RolePlay [0.3c]\gamemodes\CYBER.pwn(35203) : error 029: invalid expression, assumed zero
C:\Users\Gangasta300\Desktop\Cyb3r RolePlay [0.3c]\gamemodes\CYBER.pwn(3520 : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#7

That's cause the string is too long, use:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 6.0, 1034.45593262,-1024.63781738,31.74446106) || IsPlayerInRangeOfPoint(playerid, 6.0, 1210.35656738,-916.02075195,42.67547607) || IsPlayerInRangeOfPoint(playerid, 6.0, 1834.03784180,-1851.03039551,13.03264713) || IsPlayerInRangeOfPoint(playerid, 6.0, 1286.09313965,-1662.60424805,13.18977451) || IsPlayerInRangeOfPoint(playerid,
6.0, 1027.52441406,-946.51159668,42.25454712) || IsPlayerInRangeOfPoint(playerid, 6.0, 1307.07653809,328.18820190,19.19758606) || IsPlayerInRangeOfPoint(playerid, 6.0, 1381.05981445,259.62057495,19.20983124))
Reply
#8

I tested it but still I Can take money from anywhere :S
Reply
#9

come on no one knows?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)