OnPlayerConnect not being called
#1

I have a weird issue, my OnPlayerConnect callback is not being called when I try to connect to the server.

Code:
public OnPlayerConnect(playerid)
{
        printf("player ID %i [IP/port: %s:%i] connected to the server", playerid);

	SpectateJoinCamera(playerid);


	if(!IsValidDynamic3DTextLabel(PlayerData[playerid][pNameTag]))
		PlayerData[playerid][pNameTag] = CreateDynamic3DTextLabel("Loading nametag...", 0xFFFFFFFF, 0.0, 0.0, 0.1, NT_DISTANCE, .attachedplayer = playerid, .testlos = 1);

	if(g_PlayerLagTimer[playerid] != -1) {

	    KillTimer(g_PlayerLagTimer[playerid]);
	    g_PlayerLagTimer[playerid] = -1;
	}

	g_LagState[playerid] = false;

	GetPlayerIp(playerid, g_PlayerIp[playerid], 16);

	PlayAudioStreamForPlayer(playerid, "https://*******/WJ2Frx");

	ResetPlayerWeapons(playerid), SetPlayerArmedWeapon(playerid, 0);

	TP_AwaitingPos[playerid][0] = -1.0;

	if (g_ServerRestart) {
		TextDrawShowForPlayer(playerid, gServerTextdraws[3]);
	}
	for(new i = 0; i != MAX_PLAYER_ATTACHED_OBJECTS; i ++) {
	    RemovePlayerAttachedObject(playerid, i);
	}

	LoadPlayerSoccerTextDraws(playerid);


   	PlayerData[playerid][pTLAttached] = 0; // FlashLight system
	PlayerData[playerid][pFLAttached] = 0; // FlashLight system

	CancelSelectTextDraw(playerid);

	GetPlayerIp(playerid, PlayerData[playerid][pIP], 16);
	GetPlayerName(playerid, PlayerData[playerid][pUsername], MAX_PLAYER_NAME + 1);

	ResetStatistics(playerid);
	CreateTextDraws(playerid);
	
	new	str[300];

	format(str, sizeof(str), "SELECT * FROM `blacklist` WHERE `Username` = '%s' OR `IP` = '%s'", ReturnName(playerid), PlayerData[playerid][pIP]);
	mysql_tquery(g_iHandle, str, "OnQueryFinished", "dd", playerid, THREAD_BAN_LOOKUP);
	
	return true;
}
Reply


Messages In This Thread
OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 03:28
Re: OnPlayerConnect not being called - by RogueDrifter - 16.01.2019, 04:52
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 09:36
Re: OnPlayerConnect not being called - by RogueDrifter - 16.01.2019, 09:37
Re: OnPlayerConnect not being called - by Kaliber - 16.01.2019, 09:38
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 12:01
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 12:22
Re: OnPlayerConnect not being called - by Hunud - 16.01.2019, 12:25
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 12:29
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 12:59
Re: OnPlayerConnect not being called - by Uberanwar - 16.01.2019, 13:16
Re: OnPlayerConnect not being called - by RogueDrifter - 16.01.2019, 22:25
Re: OnPlayerConnect not being called - by Uberanwar - 30.01.2019, 06:26
Re: OnPlayerConnect not being called - by fiki574 - 30.01.2019, 07:09

Forum Jump:


Users browsing this thread: 2 Guest(s)