Bug on send request to OnPlayerConnect
#1

Hello,

I have this code:
Код:
for(new i = 0; i < MAX_PLAYERS; ++i)
	{
		if(IsPlayerConnected(i))
		{
			OnPlayerConnect(i);
		}
	}
end when i press F5 i got stupid error:
(180) : error 017: undefined symbol "hooked".
(180) : error 029: invalid expression, assumed zero


What i must do?
Reply
#2

What are you trying to accomplish with that code?
Reply
#3

I want to "reload" all player vars that on OnPlayerConnect
Reply
#4

make a function you dumb

like this :

Код:
foward MyDamnFunction(playerid);

new i = 0;
while( i < GetMaxPlayers(); ) {
   CallLocalFunction("MyDamnFunction","i",i);
   i++;
}

public MyDamnFunction(playerid)
{
   // your Player Vars here
   return 1;
}
Reply
#5

But i want call OnPlayerConnect.
Don't say me create another function.
Reply
#6

I fund the problem.
this is in sscanf2:
Код:
/*
  OnPlayerConnect

  Called when a player connects.  Actually increments an internal count so that
  if a script ends and "OnPlayerDisconnect" is called then "sscanf" still knows
  that the player is really connected.  Also stores their name internally.
*/

public OnPlayerConnect(playerid)
{
	new
		name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof (name));
	SSCANF_Join(playerid, name, IsPlayerNPC(playerid));
	return SSCANF_OnPlayerConnect(playerid);
}

#if defined _ALS_OnPlayerConnect
	#undef OnPlayerConnect
#else
	#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect(%0) SSCANF_OnPlayerConnect(%0) <_ALS_:hooked>

forward SSCANF_OnPlayerConnect(playerid);

public SSCANF_OnPlayerConnect(playerid) <_ALS_:unhooked>
{
	return 1;
}

public SSCANF_OnPlayerConnect(playerid) <>
{
	return 1;
}
What to do?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)