[FIXED :D] Compiler shows warning... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [FIXED :D] Compiler shows warning... (
/showthread.php?tid=132386)
[FIXED :D] Compiler shows warning... -
¤Adas¤ - 07.03.2010
Hello. Here are the two lines:
pawn Код:
ServerInfo[ToggleChat] = !ServerInfo[ToggleChat];
ServerInfo[ToggleVehicleLock] = !ServerInfo[ToggleVehicleLock];
And compiler shows these warnings:
Код:
D:\GTA San Andreas\Server\gamemodes\New.pwn(1389) : warning 226: a variable is assigned to itself (symbol "ServerInfo")
D:\GTA San Andreas\Server\gamemodes\New.pwn(1398) : warning 226: a variable is assigned to itself (symbol "ServerInfo")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
But here it works:
pawn Код:
PlayerInfo[CMD_ID][Mute] = !PlayerInfo[CMD_ID][Mute];
Please, how to fix it?
Re: [HELP] Compiler shows warning... -
Mechscape - 07.03.2010
Код:
PlayerInfo[ToggleChat] = !PlayerInfo[ToggleChat];
PlayerInfo[ToggleVehicleLock] = !PlayerInfo[ToggleVehicleLock];
Re: [HELP] Compiler shows warning... -
¤Adas¤ - 07.03.2010
OMG... It is ServerInfo...
Re: [HELP] Compiler shows warning... -
¤Adas¤ - 07.03.2010
No one can help? Because the code works, but i really hate warnings...
Re: [HELP] Compiler shows warning... -
Mechscape - 07.03.2010
Simple just ignore that error's.
// Like ServerInfo doens't exist.
Re: [HELP] Compiler shows warning... -
¤Adas¤ - 07.03.2010
Yes, but I hate warnings. That is the problem.

And I wanna know, why compiler shows this error only on variable ServerInfo...
Re: [HELP] Compiler shows warning... -
Carlton - 07.03.2010
Код:
PlayerInfo[ToggleChat] != PlayerInfo[ToggleChat];
PlayerInfo[ToggleVehicleLock] != PlayerInfo[ToggleVehicleLock];
Re: [HELP] Compiler shows warning... -
¤Adas¤ - 07.03.2010
Quote:
Originally Posted by Carlton
Код:
PlayerInfo[ToggleChat] != PlayerInfo[ToggleChat];
PlayerInfo[ToggleVehicleLock] != PlayerInfo[ToggleVehicleLock];
|
This expression returns true or false. In this use, it have no effect.
Re: [HELP] Compiler shows warning... -
Carlton - 07.03.2010
False.
Код:
!= - Means it doesn't match.
Re: [HELP] Compiler shows warning... -
¤Adas¤ - 07.03.2010
Yes, but it doesn't change the variable... Anyway, I fixed it. I don't like it, because it takes 30 characters more pawn code, but fixed.

But there is still question... Why this code doesn't work only for this variable?