Server Crashes -
Blademaster680 - 30.11.2014
Hi
My server keeps crashing and dont know why?
Please can someone help me here?
I am using crashedetect.
Here is my server log:
Код:
[16:21:08] Incoming connection: 105.229.56.70:52658
[16:21:09] [join] Alberto_Koslov has joined the server (0:105.229.56.70)
[16:21:24] Incoming connection: 105.237.202.142:51849
[16:21:24] [join] Jason_Smith has joined the server (1:105.237.202.142)
[16:25:15] Incoming connection: 186.120.22.136:57294
[16:25:18] [join] sterlyn_calderon has joined the server (2:186.120.22.136)
[16:25:35] [debug] Run time error 4: "Array index out of bounds"
[16:25:35] [debug] Accessing element at index 41 past array upper bound 40
[16:25:35] [debug] AMX backtrace:
[16:25:35] [debug] #0 00012d50 in ?? (194) from LLA_v0.1.amx
[16:25:35] [debug] #1 000aa3a0 in ?? (1, 2, 1) from LLA_v0.1.amx
[16:25:35] [debug] #2 0000ca24 in public OnPlayerStateChange (1, 2, 1) from LLA_v0.1.amx
[16:27:12] [debug] Run time error 4: "Array index out of bounds"
[16:27:12] [debug] Accessing element at index 41 past array upper bound 40
[16:27:12] [debug] AMX backtrace:
[16:27:12] [debug] #0 00012d50 in ?? (194) from LLA_v0.1.amx
[16:27:12] [debug] #1 000aa3a0 in ?? (2, 2, 1) from LLA_v0.1.amx
[16:27:12] [debug] #2 0000ca24 in public OnPlayerStateChange (2, 2, 1) from LLA_v0.1.amx
[16:28:02] [debug] Run time error 4: "Array index out of bounds"
[16:28:02] [debug] Accessing element at index 41 past array upper bound 40
[16:28:02] [debug] AMX backtrace:
[16:28:02] [debug] #0 00012d50 in ?? (194) from LLA_v0.1.amx
[16:28:02] [debug] #1 000aa3a0 in ?? (1, 2, 1) from LLA_v0.1.amx
[16:28:02] [debug] #2 0000ca24 in public OnPlayerStateChange (1, 2, 1) from LLA_v0.1.amx
[16:28:17] [part] sterlyn_calderon has left the server (2:1)
[16:30:53] Incoming connection: 105.184.124.48:62158
[16:30:56] [join] Brendan_White has joined the server (2:105.184.124.48)
[16:31:05] [debug] Run time error 4: "Array index out of bounds"
[16:31:05] [debug] Accessing element at index 41 past array upper bound 40
[16:31:05] [debug] AMX backtrace:
[16:31:05] [debug] #0 00012d50 in ?? (194) from LLA_v0.1.amx
[16:31:05] [debug] #1 000aa3a0 in ?? (0, 2, 1) from LLA_v0.1.amx
[16:31:05] [debug] #2 0000ca24 in public OnPlayerStateChange (0, 2, 1) from LLA_v0.1.amx
[16:31:41] [debug] Run time error 4: "Array index out of bounds"
[16:31:41] [debug] Accessing element at index 41 past array upper bound 40
[16:31:41] [debug] AMX backtrace:
[16:31:41] [debug] #0 00012d50 in ?? (194) from LLA_v0.1.amx
[16:31:41] [debug] #1 000aa3a0 in ?? (0, 2, 1) from LLA_v0.1.amx
[16:31:41] [debug] #2 0000ca24 in public OnPlayerStateChange (0, 2, 1) from LLA_v0.1.amx
[16:33:05] [part] Brendan_White has left the server (2:0)
[16:34:53] Incoming connection: 105.184.124.48:52382
Re: Server Crashes -
osman2571 - 30.11.2014
check public OnPlayerStateChange
you don't make something fine
Re: Server Crashes -
Blademaster680 - 30.11.2014
Could that cause it to crash? something that is in there?
Re: Server Crashes -
osman2571 - 30.11.2014
yes,something you don't make fine in that public.
Try remember what you make last in that public and try to fix that..
Or backup that public from old version of your gamemode
Re: Server Crashes -
Blademaster680 - 30.11.2014
Here is the OnPlayerStateChange. I cant see any issues...
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(playerid, 0);
if(!IsPlayerAdmin(playerid))
{
new vid = GetVehicleID(GetPlayerVehicleID(playerid));
if(vInfo[vid][vDealer] == 1)
{
new str[128];
format(str, sizeof(str), "Price: $%d\nWould you like to buy\nthis car?", vInfo[vid][vPrice]);
ShowPlayerDialog(playerid, DIALOG_VBUY, DIALOG_STYLE_MSGBOX, "Buy Vehicle", str, "Buy", "Cancel");
SetPVarInt(playerid, "DealershipVehicle", vInfo[vid][vModel]);
}
}
if(newstate == 2)
{
if(IsLAPDVeh(GetPlayerVehicleID(playerid)) && pInfo[playerid][pFaction] != 1)
{
RemovePlayerFromVehicle(playerid);
}
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
{
if(GetPlayerMoney(playerid) < TransportValue[i])
{
format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playerid);
}
else
{
if(TransportDuty[i] == 1)
{
format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Passenger %s has entered your Taxi.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
pInfo[playerid][pCash] -= TransportValue[i];
TransportMoney[i] += TransportValue[i];
TransportTime[i] = 1;
TransportTime[playerid] = 1;
TransportCost[playerid] = TransportValue[i];
TransportCost[i] = TransportValue[i];
TransportDriver[playerid] = i;
KillTimer(TaxiDestTimer[i]);
TaxiCall = 999;
DisablePlayerCheckpoint(i);
}
}
}
}
}
}
return 1;
}
Re: Server Crashes -
osman2571 - 30.11.2014
try center text
Re: Server Crashes -
Blademaster680 - 30.11.2014
center text?
Re: Server Crashes -
osman2571 - 30.11.2014
you should try to backup that public and recompile script
Re: Server Crashes -
Blademaster680 - 30.11.2014
Please explain. I dont really understand what you mean
Re: Server Crashes -
PowerPC603 - 30.11.2014
Check every array you access in that callback and make sure you don't go over it's limits.
Becuase your error-log says that you're accessing array-index 41, while the array has only 40 elements (41 in fact because index 0 is also an index).
So search for arrays of size 41 (this would give indices 0 to 40) and figure out where you access index 41.