SA-MP Forums Archive
rBits: error 001: unexpected token - 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: rBits: error 001: unexpected token (/showthread.php?tid=655838)



rBits: tag mismatch - venomlivno8 - 30.06.2018

Код:
player/data.pwn(12) : warning 213: tag mismatch
Error line:
Код:
rBit1_Set(Session[i], playerid, 0);
Whole function:

Код:
forward ReloadSession(playerid);
public ReloadSession(playerid) {
	for(new i = 0; i < sizeof(Session); i++) {
		rBit1_Set(Session[i], playerid, 0);
	}
	return 1;
}
Session declaration and the enum

Код:
enum E_SESSION_DATA {
	sSpawned,
	sLoggedIn
};

new 
	rBit1: Session[E_SESSION_DATA]<MAX_PLAYERS>



Re: rBits: error 001: unexpected token - JasonRiggs - 01.07.2018

I can't understand what you're trying to do..


Re: rBits: error 001: unexpected token - Akeem - 01.07.2018

If i understand what your trying to do your code should be

Код:
enum E_SESSION_DATA {
	sSpawned,
	sLoggedIn
};

new 
	rBit1: Session[MAX_PLAYERS][E_SESSION_DATA]
Код:
  
forward ReloadSession(playerid);
public ReloadSession(playerid) {
	for(new i = 0; i < MAX_PLAYERS; i++) {
		rBit1_Set(Session[i][sLoggedIn], playerid, 0);
	}
	return 1;
}