Problem whit a Varible
#1

Hello my Varible code looks like this

InTopOfScript:
Код:
new Enable = true;
OnGameModeInit()
Код:
Enable = true;//This i think does so when i start up the server its enable the Ooc chat
OnPlayerCommandText()
Код:
if(Enable == true)
But Still i get those warnings

Код:
C:\Users\Steven\Desktop\Server\gamemodes\Streetlife.pwn(180) : warning 213: tag mismatch
C:\Users\Steven\Desktop\Server\gamemodes\Streetlife.pwn(188) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
anyone knows how i cloud fix the varibles warnings ?

Oh btw
Код:
if(Enable == true)// is line 180
and
Код:
if(Enable == false)// is line 188
Reply
#2

You don't need to define "Enable" again at OnGameModeInit()

Just do

new Enable = 1;


if(Enable == 1){
// whatever you want do it here
return 1;
}
Reply
#3

pawn Код:
new bool:Enable = true;
It says tag-mismatch, because you didnt declare it as boolean (bool = true/false). Just watch the code i added above.

Cheers.

#Edit#: First :P
Reply
#4

Quote:
Originally Posted by ZutDenOpFraSlap
pawn Код:
if(Enable == true)
pawn Код:
if(Enable == false)
Your variable is a normal integer, you can't check for true/false unless you set it as bool.

pawn Код:
new
    bool:Enable = true;
Reply
#5

Oh ok many Thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)