Server Crashing - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Crashing (
/showthread.php?tid=394063)
Server Crashing -
Darklom - 21.11.2012
I'm using the plugin CrashDetector to try and find the trace but I can't seem to find the issue.
Код:
[debug] AMX backtrace:
[debug] #1 0022c2e0 in ResetPlayerWeaponsEx (playerid=2282384) at pwn:44704
[debug] #2 0012c934 in public OnPlayerCommandText (playerid=1, cmdtext[]=@0x0088d700 "rn to the base and deliver the..."):22761
[debug] Server crashed while executing script.amx
Line 44704
pawn Код:
stock ResetPlayerWeaponsEx(playerid)
{
for(new i = 0; i < 50; i++)
{
Weapons[playerid][i] = 0;
}
return ResetPlayerWeapons(playerid); // THIS LINE TO BE EXACT.
}
Line 22761
pawn Код:
PlayerInfo[playerid][pInvWeapon] = 0;
Re: Server Crashing -
niels44 - 21.11.2012
shouldnt it be:
pawn Код:
stock ResetPlayerWeaponsEx(playerid)
{
for(new i = 0; i < 50; i++)
{
PlayerInfo[i][pInvWeapon] = 0;
}
return ResetPlayerWeapons(playerid); // THIS LINE TO BE EXACT.
}
??
Re: Server Crashing -
Darklom - 21.11.2012
It has not fixed the issue.
Re: Server Crashing -
Darklom - 22.11.2012
I am completely out of ideas, have tried everything and it's urgent that I get this fixed.
Re: Server Crashing -
Azazelo - 22.11.2012
pawn Код:
stock ResetPlayerWeaponsEx(playerid)
{
for(new i = 0; i < 50; i++)
{
Weapons[playerid][i] = 0;
}
if(IsPlayerConnected(playerid))
{
return ResetPlayerWeapons(playerid); // THIS LINE TO BE EXACT.
}
return -1;
}
Re: Server Crashing -
Darklom - 22.11.2012
Any other ideas to why the server would be crashing when a certain command is entered?
Re: Server Crashing -
Smally - 22.11.2012
Show us the command.
Re: Server Crashing -
Darklom - 22.11.2012
pawn Код:
if(strcmp(cmd, "/acceptdeath", true) == 0)
{
if(dying[playerid] == 1) {
Hospitalizeds[playerid] = 0;
dying[playerid] = 0;
pUncountious[playerid] = 0;
TogglePlayerControllable(playerid, 1);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
TogglePlayerControllable(playerid,1);
new rand;
rand = random(sizeof(gRandomHospitalSpawns));
DOO_SetPlayerPos(playerid, gRandomHospitalSpawns[rand][0], gRandomHospitalSpawns[rand][1], gRandomHospitalSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(playerid, 270.0);
FadePlayerScreen(playerid,COLOR_BLACK, 40);
SetCameraBehindPlayer(playerid);
OnePlayAnim(playerid,"INT_HOUSE","LOU_Out",4.0,0,0,0,0,0);
SetPlayerDrunkLevel(playerid, 0);
SetPlayerHealth(playerid, 30.0);
Hospitalizeds[playerid] = 0;
//Usinganim[playerid] = 0;
ResetPlayerWeaponsEx(playerid);
PlayerInfo[playerid][pInvWeapon] = 0;
PlayerInfo[playerid][pInvAmmo] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "You have been release from the hospital.");
SendClientMessage(playerid, COLOR_LIGHTRED, "((Remember you have lost 30 minutes of memory.))");
}
return 1;
}
pawn Код:
else if(PlayerDied[playerid] == 1) {
SetTimerEx("FallPlayer", 100, 0, "d", playerid);
SetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
SetPlayerInterior(playerid, DeadInt[playerid]);
SetPlayerVirtualWorld(playerid, DeadWorld[playerid]);
SetPlayerCameraPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]+5);
SetPlayerCameraLookAt(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
TogglePlayerControllableEx(playerid,0);
SendClientMessage(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you will die.");
SendClientMessage(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath.");
pUncountious[playerid] = 1;
gPlayerUsingLoopingAnim[playerid] = 1;
dying[playerid] = 1;
Usinganim[playerid] = 1;
return 1;
}