SA-MP Forums Archive
Dini bool problem - 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: Dini bool problem (/showthread.php?tid=523041)



Dini bool problem - cnoopers - 30.06.2014

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?


Re: Dini bool problem - RedFusion - 30.06.2014

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



Re: Dini bool problem - cnoopers - 30.06.2014

Код:
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.



Re: Dini bool problem - cnoopers - 30.06.2014

refresh


Re: Dini bool problem - greentarch - 30.06.2014

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;



Re: Dini bool problem - speed258 - 30.06.2014

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]);




Re: Dini bool problem - cnoopers - 30.06.2014

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


Re: Dini bool problem - ikkentim - 30.06.2014

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

dini's bool system doesn't actually use bools.


Re: Dini bool problem - cnoopers - 30.06.2014

now i got there tag mismatch


Re: Dini bool problem - cnoopers - 30.06.2014

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)