I Can't seem to fix AMX Bracket.. -
So, mine script has been lagging alot, that's why I've enabled debug and checkd what could cause it, this is what I've got spammed all over my log.
I've never had something like this before, so I dont really know what code do I have to show in order for you to help me but I am guessing it's OnGameModeInit and OnVehicleSpawn.
Код:
public OnGameModeInit()
{
UsePlayerPedAnims();
CheckFiles();
SetGameModeText(SERVER_GM_TEXT);
SendRconCommand("hostname Asgard RPG");
SendRconCommand("weburl www.Asgard-RPG.com");
SendRconCommand("mapname San Andreas");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
EnableStuntBonusForAll(0);
DisableInteriorEnterExits();
ShowPlayerMarkers(1);
UsePlayerPedAnims();
LoadStaticVehicles();
LoadObjects();
LoadFactions();
LoadFamilies();
LoadPoints();
LoadBiz();
LoadHouses();
LoadDoors();
LoadGates();
LoadMapIcons();
LoadArrestPoint();
LoadDrugs();
LoadProducts();
LoadPickups();
LoadMOTDS();
// Animations
txtAnimHelper = TextDrawCreate(610.0, 400.0, "~r~~k~~PED_SPRINT~ ~w~to stop the animation");
TextDrawUseBox(txtAnimHelper, 0);
TextDrawFont(txtAnimHelper, 2);
TextDrawSetShadow(txtAnimHelper,0); // no shadow
TextDrawSetOutline(txtAnimHelper,1); // thickness 1
TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
TextDrawColor(txtAnimHelper,0xFFFFFFFF);
TextDrawAlignment(txtAnimHelper,3); // align right
// report bug
SetTimer("Bug", 300000, true);
// Time
TimeTD = TextDrawCreate(633.000000,428.000000,"Time");
TextDrawFont(TimeTD,1);
TextDrawSetShadow(TimeTD,0);
TextDrawSetOutline(TimeTD,1);
TextDrawAlignment(TimeTD,3);
TextDrawLetterSize(TimeTD,0.399999,1.500000);
TextDrawColor(TimeTD,0x00B2EEFF);
// Website
// Time
WebTD = TextDrawCreate(633.000000,412.000000,"~w~www.asgard-rpg.com");
TextDrawFont(WebTD,1);
TextDrawSetShadow(WebTD,0);
TextDrawSetOutline(WebTD,1);
TextDrawAlignment(WebTD,3);
TextDrawLetterSize(WebTD,0.399999,1.500000);
TextDrawColor(WebTD,COLOR_WHITE);
// Tutorial Blackbox
TutorialTD = TextDrawCreate(424.000000, 3.000000, " ");
TextDrawBackgroundColor(TutorialTD, 255);
TextDrawFont(TutorialTD, 1);
TextDrawLetterSize(TutorialTD, 0.500000, 1.000000);
TextDrawColor(TutorialTD, -1);
TextDrawSetOutline(TutorialTD, 0);
TextDrawSetProportional(TutorialTD, 1);
TextDrawSetShadow(TutorialTD, 1);
TextDrawUseBox(TutorialTD, 1);
TextDrawBoxColor(TutorialTD, 255);
TextDrawTextSize(TutorialTD, 14.000000, 0.000000);
// Bank Robbery
Textdraw0 = TextDrawCreate(490.000000, 155.000000, "~r~Bank Robbers:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.450000, 1.300000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(490.000000, 171.000000, "Robber 1");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.450000, 1.300000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2 = TextDrawCreate(490.000000, 185.000000, "Robber 2");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.450000, 1.300000);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3 = TextDrawCreate(490.000000, 199.000000, "Robber 3");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.450000, 1.300000);
TextDrawColor(Textdraw3, -1);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
Textdraw4 = TextDrawCreate(490.000000, 213.000000, "Robber 4");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.450000, 1.300000);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);
Textdraw5 = TextDrawCreate(490.000000, 227.000000, "Robber 5");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 1);
TextDrawLetterSize(Textdraw5, 0.450000, 1.300000);
TextDrawColor(Textdraw5, -1);
TextDrawSetOutline(Textdraw5, 1);
TextDrawSetProportional(Textdraw5, 1);
// Timers
SetTimer("Clock", 1000, true);
SetTimer("ADTimer", 1000, true);
SetTimer("NOPSetPlayerPos", 1000, true);
SetTimer("SaveServer", 3600000, true);
SetTimer("AltTabTimer", 1000, true);
SetTimer("WeaponCheat", 1000, true);
SetTimer("FuelTimer", 1000, true);
SetTimer("PrisonTimer", 1000, true);
SetTimer("LoyalFeatures", 60000, true);
for(new i=0; i<MAX_VEHICLES; i++)
{
Fuel[i] = 100;
SetVehicleToRespawn(i);
}
ConnectNPC("BusDriver", "NPCBus");
NPCBus = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
//MDC TEXTDRAWS
Textdraw10 = TextDrawCreate(480.000000, 116.000000, ".");
TextDrawBackgroundColor(Textdraw10, 255);
TextDrawFont(Textdraw10, 1);
TextDrawLetterSize(Textdraw10, 0.500000, 24.399999);
TextDrawColor(Textdraw10, 0xFFFFFF00);
TextDrawSetOutline(Textdraw10, 0);
TextDrawSetProportional(Textdraw10, 1);
TextDrawSetShadow(Textdraw10, 0);
TextDrawUseBox(Textdraw10, 1);
TextDrawBoxColor(Textdraw10, 65535);
TextDrawTextSize(Textdraw10, 150.000000, 0.000000);
Textdraw11 = TextDrawCreate(161.000000, 120.000000, "San Andreas Police Department Mobile Data Computer");
TextDrawBackgroundColor(Textdraw11, 255);
TextDrawFont(Textdraw11, 2);
TextDrawLetterSize(Textdraw11, 0.250000, 1.000000);
TextDrawColor(Textdraw11, -1);
TextDrawSetOutline(Textdraw11, 0);
TextDrawSetProportional(Textdraw11, 1);
TextDrawSetShadow(Textdraw11, 1);
Textdraw13 = TextDrawCreate(488.000000, 104.000000, ".");
TextDrawBackgroundColor(Textdraw13, 255);
TextDrawFont(Textdraw13, 1);
TextDrawLetterSize(Textdraw13, 0.500000, 1.000000);
TextDrawColor(Textdraw13, 0xFFFFFF00);
TextDrawSetOutline(Textdraw13, 0);
TextDrawSetProportional(Textdraw13, 1);
TextDrawSetShadow(Textdraw13, 0);
TextDrawUseBox(Textdraw13, 1);
TextDrawBoxColor(Textdraw13, 33023);
TextDrawTextSize(Textdraw13, 141.000000, 0.000000);
Textdraw14 = TextDrawCreate(494.000000, 339.000000, ".");
TextDrawBackgroundColor(Textdraw14, 255);
TextDrawFont(Textdraw14, 1);
TextDrawLetterSize(Textdraw14, 0.500000, 1.000000);
TextDrawColor(Textdraw14, 0xFFFFFF00);
TextDrawSetOutline(Textdraw14, 0);
TextDrawSetProportional(Textdraw14, 1);
TextDrawSetShadow(Textdraw14, 0);
TextDrawUseBox(Textdraw14, 1);
TextDrawBoxColor(Textdraw14, 33023);
TextDrawTextSize(Textdraw14, 141.000000, 0.000000);
Textdraw15 = TextDrawCreate(476.000000, 104.000000, ".");
TextDrawBackgroundColor(Textdraw15, 255);
TextDrawFont(Textdraw15, 1);
TextDrawLetterSize(Textdraw15, 0.000000, 26.100000);
TextDrawColor(Textdraw15, 0xFFFFFF00);
TextDrawSetOutline(Textdraw15, 0);
TextDrawSetProportional(Textdraw15, 1);
TextDrawSetShadow(Textdraw15, 0);
TextDrawUseBox(Textdraw15, 1);
TextDrawBoxColor(Textdraw15, 33023);
TextDrawTextSize(Textdraw15, 491.000000, 47.000000);
Textdraw16 = TextDrawCreate(144.000000, 104.000000, ".");
TextDrawBackgroundColor(Textdraw16, 255);
TextDrawFont(Textdraw16, 1);
TextDrawLetterSize(Textdraw16, 0.500000, 26.100000);
TextDrawColor(Textdraw16, 0xFFFFFF00);
TextDrawSetOutline(Textdraw16, 0);
TextDrawSetProportional(Textdraw16, 1);
TextDrawSetShadow(Textdraw16, 0);
TextDrawUseBox(Textdraw16, 1);
TextDrawBoxColor(Textdraw16, 33023);
TextDrawTextSize(Textdraw16, 159.000000, 34.000000);
return 1;
}
Re: I Can't seem to fix AMX Bracket.. -
If in a script function SetVehicleToRespawn is used in OnVehicleSpawn callback, that would crash the server because it's like an infinite loop.
Re: I Can't seem to fix AMX Bracket.. -
Yeah I know, Im not a begginer-.. The script works, it's playable but it has big lagwaves because of that AMX Bracket I believe.
AW: I Can't seem to fix AMX Bracket.. -
and you should use this to get the wrong script line.
write in this file -d3.
recompile you script and you server and you should see the wrong line in the server_log.
Re: I Can't seem to fix AMX Bracket.. -
The -d3 thing didn't seem to help, nothing came out in the server_log I've tried multiple times.
Re: I Can't seem to fix AMX Bracket.. -
I've found another, I think this one might be causing more lag, since it's spamming when players are online
AW: I Can't seem to fix AMX Bracket.. -
you foreach ..
Re: I Can't seem to fix AMX Bracket.. -