Gamemode Crash when OPTD runs
#1

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(playeridissueridFloat:amountweaponid)
{
    new 
Float:Pos[3];
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
weaponid == SLAP_GUN && issuerid == DildoSlapper && Dead[playerid] != true)
        {
            
GameTextForPlayer(playerid"~r~DEAD~w~!"30005);
            
GameTextForPlayer(playerid"~g~KILLED~w~!"30005);
            
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
            
pActor[playerid] = CreateActor(296Pos[0], Pos[1], Pos[2], 0.0);
            
ApplyActorAnimation(pActor[playerid], "WUZI""CS_Dead_Guy",1.001110);
            
Dead[playerid] = true;
            
currDead++;
            
AliveRunners--;
            
EditText();
            
TogglePlayerSpectating(playeridtrue);
            
PlayerSpectatePlayer(playeridissueridSPECTATE_MODE_NORMAL);
            if(
currDead == (FixPlayers() - 1))
            {
                
EndGame();
            }
        }
    }
    return 
1;

Any ideas? Appreciated.
Reply
#2

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(playeridissueridFloat:amountweaponid)
{
    new 
Float:Pos[3];
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
weaponid == SLAP_GUN && issuerid == DildoSlapper && Dead[playerid] != true)
        {
            
GameTextForPlayer(playerid"~r~DEAD~w~!"30005);
            
GameTextForPlayer(playerid"~g~KILLED~w~!"30005);
            
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
            
pActor[playerid] = CreateActor(296Pos[0], Pos[1], Pos[2], 0.0);
            
ApplyActorAnimation(pActor[playerid], "WUZI""CS_Dead_Guy",1.001110);
            
Dead[playerid] = true;
            
currDead++;
            
AliveRunners--;
            
EditText();
            
TogglePlayerSpectating(playeridtrue);
            
PlayerSpectatePlayer(playeridissueridSPECTATE_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
Reply
#3

That's the only backtrace that I got.

PHP код:
[21:40:02] [debugAMX backtrace:
[
21:40:02] [debug#0 00000014 in public OnPlayerTakeDamage (0, 1, 1083430667, 10, 3) from Kevin.amx 
Reply
#4

Quote:
Originally Posted by aoky
Посмотреть сообщение
That's the only backtrace that I got.

PHP код:
[21:40:02] [debugAMX 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.
Reply
#5

It's all I get.
Reply
#6

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.
Reply
#7

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?
Reply
#8

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.
Reply
#9

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 0issuerid 1Float:damage 4.62weaponid 10bodypart 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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)