sscanf2 Error when compiling script
#3

Hm, well I know there are multiple of these in the lines, but I don't know how exactly I can change up that variable to not be in there twice.

Код:
	public OnFilterScriptInit()
	{
	    new
143 		name[MAX_PLAYER_NAME];
144
145		SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
146		SSCANF_gInit = true;
147		
148		// Check if there are any players that aren't initialized.
149		for (new i = 0; i < MAX_PLAYERS; i ++)
150		{
151		    if (IsPlayerConnected(i) && !SSCANF_IsConnected(i))
152		    {
153		        GetPlayerName(i, name, MAX_PLAYER_NAME);
154		        SSCANF_Join(i, name, IsPlayerNPC(i));
155		    }
156		}
Adding the line numbers in on this.

This is what the code is shadowing

Код:
	public OnGameModeInit()
	{
		if (!SSCANF_gInit)
		{
		    new
187		        name[MAX_PLAYER_NAME];
188		
189			SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
190			SSCANF_gInit = true;
191			
192			// Check if there are any players that aren't initialized.
193			for (new i = 0; i < MAX_PLAYERS; i ++)
194			{
195			    if (IsPlayerConnected(i) && !SSCANF_IsConnected(i))
196			    {
197			        GetPlayerName(i, name, MAX_PLAYER_NAME);
198			        SSCANF_Join(i, name, IsPlayerNPC(i));
199			    }
			}
The main line here is MAX_PLAYER_NAME which I don't see anyway of changing that without causing anymore problems. I know for some variables you can change them slightly to insure no shadowing. But I'm not sure about this... I've tried changing the variable, and made sure to define the variables ( I think anyways) But still get the same error. I feel like I'm missing something....
Reply


Messages In This Thread
sscanf2 Error when compiling script - by JonnyDeath - 01.01.2018, 03:54
Re: sscanf2 Error when compiling script - by MEW273 - 01.01.2018, 04:29
Re: sscanf2 Error when compiling script - by JonnyDeath - 01.01.2018, 08:39
Re: sscanf2 Error when compiling script - by MEW273 - 01.01.2018, 08:55
Re: sscanf2 Error when compiling script - by RogueDrifter - 01.01.2018, 09:29
Re: sscanf2 Error when compiling script - by rfr - 01.01.2018, 10:00
Re: sscanf2 Error when compiling script - by Logic_ - 01.01.2018, 10:27
Re: sscanf2 Error when compiling script - by JonnyDeath - 01.01.2018, 20:54

Forum Jump:


Users browsing this thread: 1 Guest(s)