08.08.2013, 15:45
Why does this bug happen from time to time? I cant seem to backtrace it either. Any one knows what is causing this bug?
No other server has reported this. At least, not yet.
The 'Kicking {} because they didn't logon to the game.' message is normal. It means the client is too slow to connect and probably has a high amount of packet loss. In previous versions of the SA-MP server, the same problem could happen, although the player would eventually just have to quit and try reconnecting. Are you sure there aren't external factors causing this problem? There could some type of packet filtering in the firewall. The physical server which hosts the game server could be under attack. You can PM me a bigger server log if you like. If most servers work fine and there are problems like this, it usually turns out that it's not caused by SA-MP. |
public OnPlayerConnect(playerid)
{
KillTimer(APlayerData[playerid][VehicleTimer]);
ResetPlayerCash(playerid);
if (IsPlayerNPC(playerid))
return 1;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
SetPlayerColor(playerid, 0xFFFFFF00);
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
APlayerData[playerid][CurrentHouse] = -1;
//so the timer can be executed again
PlayerInfo[playerid][SpawnDance] = true;
APlayerData[playerid][LastPmID] = -1;
APlayerData[playerid][TruckerLicense] = 1;
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //preventing a bug for the animation not being applied the first time OnPlayerRequestClass is called
OnPlayConnect(playerid);
GetPlayerName(playerid, APlayerData[playerid][Name], MAX_PLAYER_NAME); // Get the players name
CheckAccountExists(playerid); // Check if the account exists
APlayerData[playerid][EngineStarted] = 0; // Engine is not started
APlayerData[playerid][gEngine] = 0; // Second variable for engine bug
//Speedometer box
SpeedBox[playerid] = TextDrawCreate(500.0, 381, " ~n~~n~~n~~n~");
TextDrawUseBox(SpeedBox[playerid], 1);
TextDrawBoxColor(SpeedBox[playerid], 0x00000066); // Set the box color of the missiontext
TextDrawTextSize(SpeedBox[playerid], 620.0, 197.0);
//Model
Model[playerid] = TextDrawCreate(500.0, 381, " ");
TextDrawFont(Model[playerid], 2);
TextDrawColor(Model[playerid], 16777215);
TextDrawSetOutline(Model[playerid], 1);
TextDrawSetShadow(Model[playerid], 0);
TextDrawSetProportional(Model[playerid], true);
TextDrawLetterSize(Model[playerid],0.280000, 1.100000); // Set the lettersize
//speedometer
Speedometer[playerid] = TextDrawCreate(500.0,401.0 , " ");
TextDrawFont(Speedometer[playerid], 2);
TextDrawColor(Speedometer[playerid], 16777215);
TextDrawSetOutline(Speedometer[playerid], 1);
TextDrawSetShadow(Speedometer[playerid], 0);
TextDrawSetProportional(Speedometer[playerid], true);
TextDrawLetterSize(Speedometer[playerid],0.280000, 1.100000); // Set the lettersize
//Fuel
Fuel[playerid] = TextDrawCreate(500.0, 411.0, " ");
TextDrawFont(Fuel[playerid], 2);
TextDrawColor(Fuel[playerid], 16777215);
TextDrawSetOutline(Fuel[playerid], 1);
TextDrawSetShadow(Fuel[playerid], 0);
TextDrawSetProportional(Fuel[playerid], true);
TextDrawLetterSize(Fuel[playerid],0.280000, 1.100000); // Set the lettersize
//Status
Status[playerid] = TextDrawCreate(500.0, 391, " ");
TextDrawFont(Status[playerid], 2);
TextDrawColor(Status[playerid], 16777215);
TextDrawSetOutline(Status[playerid], 1);
TextDrawSetProportional(Status[playerid], true);
TextDrawSetShadow(Status[playerid], 0);
TextDrawLetterSize(Status[playerid],0.280000, 1.100000); // Set the lettersize
//Missiontext
Mission[playerid] = TextDrawCreate(320.0, 430.0, " "); // Setup the missiontext at the bottom of the screen
TextDrawAlignment(Mission[playerid], 2); // Align the missiontext to the center
TextDrawUseBox(Mission[playerid], 1); // Set the missiontext to display inside a box
TextDrawBoxColor(Mission[playerid], 0x00000066); // Set the box color of the missiontext
TextDrawFont(Mission[playerid], 2);
TextDrawBackgroundColor(Mission[playerid], 255);
TextDrawFont(Mission[playerid], 2);
TextDrawLetterSize(Mission[playerid], 0.260000, 1.300000);
TextDrawSetOutline(Mission[playerid], 0);
TextDrawSetProportional(Mission[playerid], 1);
TextDrawSetShadow(Mission[playerid], 1);
//Fineboard
Fineboard[playerid] = TextDrawCreate(499.0, 105.0, " ");
TextDrawUseBox(Fineboard[playerid], 1);
TextDrawBoxColor(Fineboard[playerid], 0x00000066);
TextDrawFont(Fineboard[playerid], 2);
TextDrawTextSize(Fineboard[playerid], 605.0, 197.0);
TextDrawLetterSize(Fineboard[playerid],0.280000, 1.100000); // Set the lettersize
//Location
APlayerData[playerid][Location] = TextDrawCreate(86.000000, 320.000000, " "); // Setup the area textdraw
TextDrawAlignment(APlayerData[playerid][Location], 2); // Align it to the left down corner
TextDrawBackgroundColor(APlayerData[playerid][Location], 255); // Set the background color
TextDrawFont(APlayerData[playerid][Location], 2); // Set the textdraws font
TextDrawLetterSize(APlayerData[playerid][Location],0.280000, 1.100000); // Set the lettersize
TextDrawColor(APlayerData[playerid][Location], -1); // Set the textdraw color
TextDrawSetOutline(APlayerData[playerid][Location], 1); // Set the outline
TextDrawSetProportional(APlayerData[playerid][Location], 1); //I dunno what this does
SetTimerEx("LocationText", 2500, true, "i", playerid);
//House car spawning
new string[128], rows, field, pname_[MAX_PLAYER_NAME];
cache_get_data(rows, field);
GetPlayerName(playerid, pname_, MAX_PLAYER_NAME);
mysql_real_escape_string(pname_, pname_);
format(string, sizeof(string), "SELECT `HouseID` FROM `Houses` WHERE `Houseowner`='%s'", pname_);
mysql_function_query( Handle, string, true, "OnPlayerHousesLoad", "d", playerid );
//Dealership mapicons
SetPlayerMapIcon(playerid, 8, 543.7410, -1292.0183, 17.2422, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 1, 2131.8037, -1150.6469, 24.1343, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 2, -1969.1692, 293.8963, 35.1719, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 3, -1656.6326, 1218.1990, 7.2500, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 4, 1671.5216, 1814.3015, 10.8203, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 5, 1948.6831, 2068.0332, 11.0610, 55, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 6, 2200.9763, 1394.8071, 11.0625, 51, 0, MAPICON_LOCAL);
SetPlayerMapIcon(playerid, 7, -2186.9683, 2413.9592, 5.1563, 55, 0, MAPICON_LOCAL);
return 1;
}