Warning + A Question
#12

Quote:
Originally Posted by nuriel8833
View Post
Hello all.
I get a warning which I know what it means but I dont know why I keep getting it:
pawn Code:
warning 211: possibly unintended assignment
Warn. line:
pawn Code:
if(reason = 0 && Finished[playerid] == 1) return Finished[playerid] = 1;
Please help.
+I have 2 questions:

1.is there any possible way to make all of this in 1 line:
pawn Code:
case 4..20: (---) case 24..30 (---) case 34..40  (---) case 44..50  (---) case 54..60
2.How can I make that if a variable has reached the number of 60 the player cant spawn anymore?

Thanks for help.
The "unintended assignment" is
pawn Code:
reason = 0
Are you trying to assign the variable "reason" to the value of 0, or are you trying to compare it to 0? If the latter is the case, than you should use the logical comparison operator of '=='.

For your 1st question, my only suggestion would be to use the modulo operator (granted it may be a tad slower than what you had in mind):
pawn Code:
if(!(1 <= variable % 10 <= 3))
Reply


Messages In This Thread
Warning + A Question - by nuriel8833 - 02.02.2012, 11:16
Re: Warning + A Question - by Wesley221 - 02.02.2012, 11:20
Re: Warning + A Question - by T0pAz - 02.02.2012, 11:21
Re: Warning + A Question - by nuriel8833 - 02.02.2012, 11:23
Re: Warning + A Question - by SampLoverNo123 - 02.02.2012, 11:27
Re: Warning + A Question - by Wesley221 - 02.02.2012, 11:30
Re: Warning + A Question - by nuriel8833 - 02.02.2012, 11:34
Re: Warning + A Question - by MP2 - 02.02.2012, 11:39
Re: Warning + A Question - by nuriel8833 - 02.02.2012, 11:43
Re: Warning + A Question - by [Diablo] - 02.02.2012, 12:22
Re: Warning + A Question - by nuriel8833 - 02.02.2012, 12:35
Re: Warning + A Question - by Tannz0rz - 02.02.2012, 13:07

Forum Jump:


Users browsing this thread: 1 Guest(s)