GarHouse V2.0 crashes server - 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: GarHouse V2.0 crashes server (
/showthread.php?tid=330972)
GarHouse V2.0 crashes server -
captainjohn - 03.04.2012
Hello everyone.
I added GarHouse V2.0 to my server and when someone connects to the server it just crashes it.
Here's what CrashDetect found.
Код:
[02:50:46] [debug] Server crashed while executing GarHouse.amx
[02:50:46] [debug] Backtrace (most recent call first):
[02:50:46] [debug] #0 ???????? in main () at C:\Users\John\Desktop\Script\filterscripts\GarHouse.pwn:3524
So I went to line 3524 in the script and this is what it was.
The whole code for this is...
pawn Код:
stock SecurityDog_Bite(playerid, houseid, type, failed = 0)
{
if(hInfo[houseid][HouseDog] == 0) return 1;
new Float:health;
GetPlayerHealth(playerid, health);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
if((health - (SECURITYDOG_HEALTHLOSS * SECURITYDOG_BITS)) <= 0.00)
{
SetPlayerHealth(playerid, 0.00);
switch(type)
{
case 0: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HBREAKIN_FAILED1);
case 1: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HROB_FAILED1);
}
}
else
{
SetPlayerHealth(playerid, (health - (SECURITYDOG_HEALTHLOSS * SECURITYDOG_BITS)));
if(failed == 1)
{
switch(type)
{
case 0: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HBREAKIN_FAILED2);
case 1: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HROB_FAILED2);
}
}
}
SetTimerEx("SecurityDog_ClearAnimations", 4000, false, "i", playerid);
return 1;
}
So I thought it maybe something to do with the Security Dog, so I deleted everything to do with the security dog and I compiled it, reloaded it and I then got this error.
Код:
[03:16:34] [debug] Server crashed while executing GarHouse.amx
[03:16:34] [debug] Backtrace (most recent call first):
[03:16:34] [debug] #0 ???????? in main () at C:\Users\John\Desktop\Script\filterscripts\GarHouse.pwn:3467
Line 3467 is this:
The whole code for this was...
pawn Код:
stock EndHouseRobbery(playerid)
{
new timer_state = GetPVarInt(playerid, "HouseRobberyTimer");
if(timer_state != -1)
{
KillTimer(timer_state);
SetPVarInt(playerid, "HouseRobberyTimer", -1);
}
return 1;
}
So is it something to do with the Returns?
Thanks.
Re: GarHouse V2.0 crashes server -
captainjohn - 03.04.2012
Any help?