Server crashes when player takes damage
#1

I have the line
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    InfoMessage(playerid, "YOU GOT SHOT!");
    return 1;
}
As soon as the callback is called, the server crashes. Crash detect isn't giving me any backtrace as to what is going on. If i comment out that bit, it doesn't crash.

I tried it on my local windows server, and it was all fine. So I changed the directory of the server on the linux box and put a fresh copy of everything in there, and it still crashes. I do get the following:

Код:
[17:48:53] [debug] Run time error 20: "Invalid index parameter (bad entry point)"
[17:48:54] [join] -----
[17:49:11] [debug] Server crashed while executing prp.amx
[17:49:11] [debug] AMX backtrace:
[17:49:11] [debug] #0 00000014 in ?? () from prp.amx
[17:49:11] [debug] #1 0002135c in ?? () from prp.amx
[17:49:11] [debug] #2 000156d4 in public OnPlayerTakeDamage () from prp.amx
[17:49:11] [debug] System backtrace:
Now, I've got the function Main in, in the first module of the script. It only does it when its on the actual linux server, and it doesnt actually provide me with a backtrace. I don't really have anything to go off of.
Reply
#2

you should better check InfoMessage()
Reply
#3

Quote:
Originally Posted by ikey07
Посмотреть сообщение
you should better check InfoMessage()
That's just a formatted string and sendclientmessage, its defo not that.

I've also got it in about 500 other spots in the script
Reply
#4

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
If(amount !=0)
{
InfoMessage(playerid, "YOU GOT SHOT!");
}
return 1;
}
Reply
#5

Quote:
Originally Posted by yvoms
Посмотреть сообщение
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
If(amount !=0)
{
InfoMessage(playerid, "YOU GOT SHOT!");
}
return 1;
}
Same thing/
Reply
#6

What happens if you put

PHP код:
if(issuerid != INVALID_PLAYER_IDInfoMessage(playerid"YOU GOT SHOT!"); 
Reply
#7

Quote:
Originally Posted by itsCody
Посмотреть сообщение
What happens if you put

PHP код:
if(issuerid != INVALID_PLAYER_IDInfoMessage(playerid"YOU GOT SHOT!"); 
Nothing.
Reply
#8

I feel like it's to do with something in InfoMessage, though you say you're formatting SendClientMessage. Something could be conflicting?
Reply
#9

Quote:
Originally Posted by itsCody
Посмотреть сообщение
I feel like it's to do with something in InfoMessage, though you say you're formatting SendClientMessage. Something could be conflicting?
I put the infomessage in after, I am 100% sure it isn't info message.

In fact, before i put the infomessage in I removed everything from that code and just made it return, and it still crashed. i put the message there to see if the function was being called first It's the function itself.
Reply
#10

Any hooked OnPlayerTakeDamage callbacks?
Else compile it with debug symbols to get exact information and line numbers.
It probably is InfoMessage though.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)