04.08.2011, 09:05
Hello,
Allow me to explain. The server starts doing weird in once. I can't remember I did anything wrong, it just happens at once. Everything in OnGameModeInit is executed in one second but it doesn't really 'execute'.
Log:
It just happens at once! It says it connected to MySQL database, but it isn't. I can just put shit in mysql_connect and it still says it connects. So it doesn't execute good. Usually it takes around 20 secs to execute. Now 1 second not good.
Version is R5.
Jochem
Allow me to explain. The server starts doing weird in once. I can't remember I did anything wrong, it just happens at once. Everything in OnGameModeInit is executed in one second but it doesn't really 'execute'.
pawn Код:
public OnGameModeInit()
{
//--------------------------- Server Protection ---------------------
new sIP[24];
GetServerVarAsString("bind",sIP,sizeof(sIP));
if(!sIP[0] || strcmp(sIP,*censored*,false))
{
for(;;)
{
for(;;)
{
SendRconCommand("exit");
}
}
}
else print("Welcome back, script owner!");
AntiDeAMX();
//---------------------------- Text Draws --------------------------
for(new i = 0; i < MAX_PLAYERS; i ++)
{
InfoBoxDraw[i] = TextDrawCreate(500.000000, 130.000000, "_");
TextDrawBackgroundColor(InfoBoxDraw[i], 255);
TextDrawFont(InfoBoxDraw[i], 1);
TextDrawLetterSize(InfoBoxDraw[i], 0.259999, 0.999998);
TextDrawColor(InfoBoxDraw[i], -1);
TextDrawSetOutline(InfoBoxDraw[i], 1);
TextDrawSetProportional(InfoBoxDraw[i], 1);
TextDrawUseBox(InfoBoxDraw[i], 1);
TextDrawBoxColor(InfoBoxDraw[i], 85);
TextDrawTextSize(InfoBoxDraw[i], 636.000000, 0.000000);
}
print("Initialized the Player Text Draws");
for(new v = 0; v < MAX_VEHICLES; v ++)
{
VehicleInfo[v][VehicleBoxDraw] = TextDrawCreate(520.000000, 369.000000, "~n~~n~~n~~n~~n~~n~~n~~n~~n~");
TextDrawBackgroundColor(VehicleInfo[v][VehicleBoxDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleBoxDraw], 1);
TextDrawLetterSize(VehicleInfo[v][VehicleBoxDraw], 0.500000, 1.000000);
TextDrawColor(VehicleInfo[v][VehicleBoxDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleBoxDraw], 0);
TextDrawSetProportional(VehicleInfo[v][VehicleBoxDraw], 1);
TextDrawSetShadow(VehicleInfo[v][VehicleBoxDraw], 1);
TextDrawUseBox(VehicleInfo[v][VehicleBoxDraw], 1);
TextDrawBoxColor(VehicleInfo[v][VehicleBoxDraw], 85);
TextDrawTextSize(VehicleInfo[v][VehicleBoxDraw], 638.000000, 0.000000);
VehicleInfo[v][VehicleNameDraw] = TextDrawCreate(544.000000, 350.000000,"Vehicle");
TextDrawBackgroundColor(VehicleInfo[v][VehicleNameDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleNameDraw], 0);
TextDrawLetterSize(VehicleInfo[v][VehicleNameDraw], 0.799999, 3.000000);
TextDrawColor(VehicleInfo[v][VehicleNameDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleNameDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleNameDraw], 1);
VehicleInfo[v][VehicleSpeedDraw] = TextDrawCreate(520.000000, 381.000000, "~r~Speed: ~w~0 M/PH");
TextDrawBackgroundColor(VehicleInfo[v][VehicleSpeedDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleSpeedDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleSpeedDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleSpeedDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleSpeedDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleSpeedDraw], 1);
VehicleInfo[v][VehicleFuelDraw] = TextDrawCreate(520.000000, 391.000000, "~r~Fuel: ~w~100 Litres");
TextDrawBackgroundColor(VehicleInfo[v][VehicleFuelDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleFuelDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleFuelDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleFuelDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleFuelDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleFuelDraw], 1);
VehicleInfo[v][VehicleLightsDraw] = TextDrawCreate(520.000000, 401.000000, "~r~Lights: ~w~Off");
TextDrawBackgroundColor(VehicleInfo[v][VehicleLightsDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleLightsDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleLightsDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleLightsDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleLightsDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleLightsDraw], 1);
VehicleInfo[v][VehicleDoorsDraw] = TextDrawCreate(520.000000, 411.000000, "~r~Doors: ~w~Unlocked");
TextDrawBackgroundColor(VehicleInfo[v][VehicleDoorsDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleDoorsDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleDoorsDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleDoorsDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleDoorsDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleDoorsDraw], 1);
VehicleInfo[v][VehicleTrunkDraw] = TextDrawCreate(520.000000, 421.000000, "~r~Trunk: ~w~Closed");
TextDrawBackgroundColor(VehicleInfo[v][VehicleTrunkDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleTrunkDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleTrunkDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleTrunkDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleTrunkDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleTrunkDraw], 1);
VehicleInfo[v][VehicleWindowsDraw] = TextDrawCreate(520.000000, 431.000000, "~r~Windows: ~w~Closed");
TextDrawBackgroundColor(VehicleInfo[v][VehicleWindowsDraw], 255);
TextDrawFont(VehicleInfo[v][VehicleWindowsDraw], 2);
TextDrawLetterSize(VehicleInfo[v][VehicleWindowsDraw], 0.300000, 0.899999);
TextDrawColor(VehicleInfo[v][VehicleWindowsDraw], -1);
TextDrawSetOutline(VehicleInfo[v][VehicleWindowsDraw], 1);
TextDrawSetProportional(VehicleInfo[v][VehicleWindowsDraw], 1);
VehicleInfo[v][Fuel] = 100;
VehicleInfo[v][Locked] = 1;
}
print("Initialized the Vehicle Textdraws");
GlobalInfo[WatchDraw] = TextDrawCreate(548.000000, 25.000000, "22:34");
TextDrawBackgroundColor(GlobalInfo[WatchDraw], 255);
TextDrawFont(GlobalInfo[WatchDraw], 2);
TextDrawLetterSize(GlobalInfo[WatchDraw], 0.470000, 3.199999);
TextDrawColor(GlobalInfo[WatchDraw], -1);
TextDrawSetOutline(GlobalInfo[WatchDraw], 1);
TextDrawSetProportional(GlobalInfo[WatchDraw], 1);
GlobalInfo[IntroTextDraw] = TextDrawCreate(305.000000, 21.000000, "The Dukes of Hazzard~n~~r~Roleplay");
TextDrawAlignment(GlobalInfo[IntroTextDraw], 2);
TextDrawBackgroundColor(GlobalInfo[IntroTextDraw], 255);
TextDrawFont(GlobalInfo[IntroTextDraw], 0);
TextDrawLetterSize(GlobalInfo[IntroTextDraw], 1.219998, 6.599997);
TextDrawColor(GlobalInfo[IntroTextDraw], -8388353);
TextDrawSetOutline(GlobalInfo[IntroTextDraw], 1);
TextDrawSetProportional(GlobalInfo[IntroTextDraw], 1);
print("Initialized the Global Textdraws");
//------------------------------ Shit -----------------------
SendRconCommand("mapname Blue Berry");
SetGameModeText("BB:RP v0.00");
DisableInteriorEnterExits();
ShowPlayerMarkers(0);
EnableStuntBonusForAll(0);
ManualVehicleEngineAndLights();
GlobalInfo[OOCEnabled] = 1;
GlobalInfo[AskEnabled] = 1;
print("Initialized the variables/arrays to their right numbers");
//if(mysql_connect("188.165.225.144","433_server","433_server",*censored*)) // GTA Multi
if(mysql_connect("88.198.43.24","jochemd","jochemd",*censored*")) // Temporary free host
{
print("Connected to the MySQL Database");
mysql_debug(1);
}
// And under this are all objects, and vehicles
Код:
[10:58:48] Welcome back, script owner! [10:58:48] Initialized the Player Text Draws [10:58:48] Initialized the Vehicle Textdraws [10:58:48] Initialized the Global Textdraws [10:58:48] Initialized the variables/arrays to their right numbers [10:58:48] Connected to the MySQL Database [10:58:48] {FFFF00}Server is fully initialized, ready to accept players. [10:58:48] Number of vehicle models: 44
Version is R5.
Jochem