16.01.2019, 03:28
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; }