Gamemode Crash when OPTD runs -
aoky - 11.09.2017
PHP код:
[debug] #0 00000014 in public OnPlayerTakeDamage (0, 1, 1083430667, 10, 3) from Kevin.amx
This happens when a player takes damage from my recent script.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new Float:Pos[3];
if(issuerid != INVALID_PLAYER_ID)
{
if(weaponid == SLAP_GUN && issuerid == DildoSlapper && Dead[playerid] != true)
{
GameTextForPlayer(playerid, "~r~DEAD~w~!", 3000, 5);
GameTextForPlayer(playerid, "~g~KILLED~w~!", 3000, 5);
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
pActor[playerid] = CreateActor(296, Pos[0], Pos[1], Pos[2], 0.0);
ApplyActorAnimation(pActor[playerid], "WUZI", "CS_Dead_Guy",1.0, 0, 1, 1, 1, 0);
Dead[playerid] = true;
currDead++;
AliveRunners--;
EditText();
TogglePlayerSpectating(playerid, true);
PlayerSpectatePlayer(playerid, issuerid, SPECTATE_MODE_NORMAL);
if(currDead == (FixPlayers() - 1))
{
EndGame();
}
}
}
return 1;
}
Any ideas? Appreciated.
Re: Gamemode Crash when OPTD runs -
[WSF]ThA_Devil - 11.09.2017
Quote:
Originally Posted by aoky
PHP код:
[debug] #0 00000014 in public OnPlayerTakeDamage (0, 1, 1083430667, 10, 3) from Kevin.amx
This happens when a player takes damage from my recent script.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new Float:Pos[3];
if(issuerid != INVALID_PLAYER_ID)
{
if(weaponid == SLAP_GUN && issuerid == DildoSlapper && Dead[playerid] != true)
{
GameTextForPlayer(playerid, "~r~DEAD~w~!", 3000, 5);
GameTextForPlayer(playerid, "~g~KILLED~w~!", 3000, 5);
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
pActor[playerid] = CreateActor(296, Pos[0], Pos[1], Pos[2], 0.0);
ApplyActorAnimation(pActor[playerid], "WUZI", "CS_Dead_Guy",1.0, 0, 1, 1, 1, 0);
Dead[playerid] = true;
currDead++;
AliveRunners--;
EditText();
TogglePlayerSpectating(playerid, true);
PlayerSpectatePlayer(playerid, issuerid, SPECTATE_MODE_NORMAL);
if(currDead == (FixPlayers() - 1))
{
EndGame();
}
}
}
return 1;
}
Any ideas? Appreciated.
|
Post more of the crash log so we could know more information on what goes wrong
Re: Gamemode Crash when OPTD runs -
aoky - 11.09.2017
That's the only backtrace that I got.
PHP код:
[21:40:02] [debug] AMX backtrace:
[21:40:02] [debug] #0 00000014 in public OnPlayerTakeDamage (0, 1, 1083430667, 10, 3) from Kevin.amx
Re: Gamemode Crash when OPTD runs -
[WSF]ThA_Devil - 11.09.2017
Quote:
Originally Posted by aoky
That's the only backtrace that I got.
PHP код:
[21:40:02] [debug] AMX backtrace:
[21:40:02] [debug] #0 00000014 in public OnPlayerTakeDamage (0, 1, 1083430667, 10, 3) from Kevin.amx
|
There definitely should be more than that. This doesn't even state why it crashed.
Re: Gamemode Crash when OPTD runs -
aoky - 11.09.2017
It's all I get.
Re: Gamemode Crash when OPTD runs -
[WSF]ThA_Devil - 11.09.2017
Then all I can suggest you is start commenting out parts of code, compile and test. I would start out by commenting out custom functions first such as EndGame() , EditText() and FixPlayers().
Do that until you find what crashes.
Re: Gamemode Crash when OPTD runs -
Vince - 11.09.2017
How come there are 5 parameters passed to the callback but your script only has 4? Seems like bodypart parameter is missing. Are you compiling with old includes and/or ignoring any warnings?
Re: Gamemode Crash when OPTD runs -
aoky - 11.09.2017
I added that earlier on, and yeah there is no error/warnings. I have a feeling it could be my YSI files, but I need the older versions which I can't seem to find, the links are dead. I'm quiet unsure as it's been a very long time since I touched this script. I'm really looking to develop it again.
Re: Gamemode Crash when OPTD runs -
Vince - 11.09.2017
Well if you're running a 0.3.7 server with a script that was designed for an older version then you're bound to run into problems one way or another. The debug message can actually be fairly easily decoded as follows:
PHP код:
OnPlayerTakeDamage (playerid = 0, issuerid = 1, Float:damage = 4.62, weaponid = 10, bodypart = 3)
(Float conversion: 1083430667 = 0x4093D70B = 4.62 IEEE-754;
https://www.h-schmidt.net/FloatConverter/IEEE754.html)
If you had compiled with 0.3.7 files like you should have it would have given you an error (yes an error, not a warning) about "function header differs from prototype" because the bodypart parameter is missing. And if the compiler throws an error then the script is broken.
Re: Gamemode Crash when OPTD runs -
aoky - 11.09.2017
I did compile it with 0.3.7 files, because I downloaded the files from the official SA:MP website. I went ahead a retested it with the new files, removed the bodypart parameter from OPTD and it still gave no errors.