[FIXED :D] Compiler shows warning...
#1

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?
Reply
#2

Код:
PlayerInfo[ToggleChat] = !PlayerInfo[ToggleChat];
PlayerInfo[ToggleVehicleLock] = !PlayerInfo[ToggleVehicleLock];
Reply
#3

OMG... It is ServerInfo...
Reply
#4

No one can help? Because the code works, but i really hate warnings...
Reply
#5

Simple just ignore that error's.

// Like ServerInfo doens't exist.
Reply
#6

Yes, but I hate warnings. That is the problem.
And I wanna know, why compiler shows this error only on variable ServerInfo...
Reply
#7


Код:
PlayerInfo[ToggleChat] != PlayerInfo[ToggleChat];
PlayerInfo[ToggleVehicleLock] != PlayerInfo[ToggleVehicleLock];
Reply
#8

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.
Reply
#9

False.
Код:
!= - Means it doesn't match.
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)