Dini bool problem
#1

hi got little problem with bool using dini include

Код:
new endedtutorial[MAX_PLAYERS];

//Register user
dini_BoolSet(Gracz,"UkonczylTutorial",false);

//loading user
endedtutorial[playerid] = dini_Bool(Gracz, "UkonczylTutorial");

//saving user
dini_BoolSet(Gracz,"UkonczylTutorial", endedtutorial[playerid]);
and now
Код:
if(endedtutorial[playerid] != false) //warning 213: tag mismatch
full if
Код:
	if(endedtutorial[playerid] != false)
	{
	    SetPlayerTime(playerid, 8, 0);
	    SetPlayerVirtualWorld(playerid, 1);
	    SetPlayerPos(playerid, 2243.9314,-1261.9626,23.9487);
	    SetPlayerFacingAngle(playerid, 270.4536);
	    SetCameraBehindPlayer(playerid);
	    endedtutorial[playerid] = 1;
	}
so i wanna add one-time tutorial on first visit on server after register and later check that user ended it at next login.
whats wrong with that?
Reply
#2

Try
pawn Код:
new bool:endedtutorial[MAX_PLAYERS];
Reply
#3

Код:
D:\DCIM\samp03z_svr_R1_win32\gamemodes\safr.pwn(477) : warning 213: tag mismatch //endedtutorial[playerid] = dini_Bool(Gracz, "UkonczylTutorial");
D:\DCIM\samp03z_svr_R1_win32\gamemodes\safr.pwn(994) : warning 213: tag mismatch //endedtutorial[playerid] = 1;
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#4

refresh
Reply
#5

Sorry, I have no idea for the first tag mismatch warning, but for the second one,
Change
pawn Код:
endedtutorial[playerid] = 1;
to
pawn Код:
endedTutorial[playerid] = true;
Reply
#6

Quote:

if(endedtutorial[playerid] != false)

change to
Quote:

if(endedtutorial[playerid] != 0)

and
Quote:

//Register user
dini_BoolSet(Gracz,"UkonczylTutorial",false);

//loading user
endedtutorial[playerid] = dini_Bool(Gracz, "UkonczylTutorial");

//saving user
dini_BoolSet(Gracz,"UkonczylTutorial", endedtutorial[playerid]);

to
Quote:

//Register user
dini_IntSet(Gracz,"UkonczylTutorial",0);

//loading user
endedtutorial[playerid] = dini_Int(Gracz, "UkonczylTutorial");

//saving user
dini_IntSet(Gracz,"UkonczylTutorial", endedtutorial[playerid]);

Reply
#7

dini_Int is a integer, right? cause it cant be for bool
Reply
#8

Replace
if(endedtutorial[playerid] != false)
with
if(endedtutorial[playerid] != 0)

dini's bool system doesn't actually use bools.
Reply
#9

now i got there tag mismatch
Reply
#10

Quote:
Originally Posted by speed258
Посмотреть сообщение
change to and
to
done but still warns

tag mismatchs
Код:
endedtutorial[playerid] = dini_Int(Gracz, "UkonczylTutorial");
Код:
if(endedtutorial[playerid] != 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)