"if" doesn't work
#1

Код:
if(batteries[id][count] > 1000 || batteries[id][count] < 1)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, " 1 - 1000!");
	            return 1;
			}
			else batteries[id][count] = c;
			
			if(batteries[id][height] > 60 || batteries[id][height] < 10)
			{
			    SendClientMessage(playerid, 0xFFFFFFFF, "10 - 60!");
			    return 1;
			}
			else batteries[id][height] = h;
			
	        batteries[id][hvar] = hv;
	        
	        if(batteries[id][windspeed] < 7 || batteries[id][windspeed] > 60)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, "7 - 60!");
	            return 1;
			}
			else batteries[id][windspeed] = w;
			
			if(batteries[id][interval] < 0.1 || batteries[id][interval] > 4)
	        {
	            SendClientMessage(playerid, 0xFFFFFFFF, "0.01 - 4!");
	            return 1;
			}
It doesn't work. When i type 1001 i don't see the message 1-1000 same thing with others.
Reply
#2

pawn Код:
batteries[id][height] > || batteries[id][height] < 10;
Reply
#3

What?
Reply
#4

Try >= and =< that might do the trick, did it for me a couple of times.
Reply
#5

instead of
pawn Код:
if(batteries[id][height] > 60 || batteries[id][height] < 10)
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "10 - 60!");
                return 1;
            }
            else batteries[id][height] = h;
Do This Man :
pawn Код:
batteries[id][height] > 60 || batteries[id][height] < 10)
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "10 - 60!");
                return 1;
            }
            else batteries[id][height] = h;
Reply
#6

not sure if your trying to do like can't exceed the numbers

so you need to do it like

Код:
if(value < 0 || value > 10000) {
// Not allowed
} else batteries[id][count] = value;
Presume that whats you mean?
Reply
#7

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
Try >= and =< that might do the trick, did it for me a couple of times.
Still doesn't work.

UltraScripter

Error on this:
Код:
else batteries[id][height] = h;
Reply
#8

[PAWN]
batteries[id][height] > 60 || batteries[id][height] < 10;
{
SendClientMessage(playerid, 0xFFFFFFFF, "10 - 60!");
return 1;
}
batteries[id][height] = h;
Reply
#9

Quote:
Originally Posted by Shaneisace
Посмотреть сообщение
not sure if your trying to do like can't exceed the numbers

so you need to do it like

Код:
if(value < 0 || value > 10000) {
// Not allowed
} else batteries[id][count] = value;
Presume that whats you mean?
it's a firework system. I'm trying to make limits for the rockets, height and etc.
Reply
#10

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
[PAWN]
batteries[id][height] > 60 || batteries[id][height] < 10;
{
SendClientMessage(playerid, 0xFFFFFFFF, "10 - 60!");
return 1;
}
batteries[id][height] = h;
Invalid expression assumed to zero:
Line: 459
Код:
{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)