SA-MP Forums Archive
Pawn one warning [Different] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawn one warning [Different] (/showthread.php?tid=608334)



Pawn one warning [Different] - Ult1mate - 30.05.2016

Hi. Pawn Compiler different one warning. :/ What is the problem
Код:
new bool:WaitFunction[MAX_PLAYERS];
if(WaitFunction[playerid] = !WaitFunction[playerid])
{
/*     Do Stuff(Codes)     */
}
return 1;
}
PHP код:
warning 211possibly unintended assignment 



Re: Pawn one warning [Different] - zSuYaNw - 30.05.2016

check your code:

PHP код:
new bool:WaitFunction[MAX_PLAYERS];
if(
WaitFunction[playerid] == (!WaitFunction[playerid]))
{
/*     Do Stuff(Codes)     */
    
return 1;




Re: Pawn one warning [Different] - DRIFT_HUNTER - 30.05.2016

Код:
if(WaitFunction[playerid] = !WaitFunction[playerid])
to
Код:
if(WaitFunction[playerid] == !WaitFunction[playerid])
Character = is to assign new value to variable, while == is to compare if two variables are equal.

[EDIT]zSuYaNw bet me to it :P


Re: Pawn one warning [Different] - oMa37 - 30.05.2016

Try this:
PHP код:
if(WaitFunction[playerid] == !WaitFunction[playerid]) 



Re: Pawn one warning [Different] - AbyssMorgan - 30.05.2016

This condition is still pointless :P


Re: Pawn one warning [Different] - iKarim - 30.05.2016

PHP код:
if(!WaitFunction[playerid]) 
I guess that's what are you looking for.


Re: Pawn one warning [Different] - ProRakNet - 30.05.2016

Код:
if(WaitFunction[playerid] == !WaitFunction[playerid])



Re: Pawn one warning [Different] - Ult1mate - 30.05.2016

Thanks everyone !!
only 1 equals, inattention :/


Re: Pawn one warning [Different] - Konstantinos - 30.05.2016

Toggling and checking directly if the condition is true will have to be:
Код:
if((WaitFunction[playerid] = !WaitFunction[playerid]))



Re: Pawn one warning [Different] - Ult1mate - 30.05.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Toggling and checking directly if the condition is true will have to be:
Код:
if((WaitFunction[playerid] = !WaitFunction[playerid]))
I guess I'm looking for this, thank you sir !