Server crashes when player takes damage -
TakeiT - 10.01.2016
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.
Re: Server crashes when player takes damage -
ikey07 - 10.01.2016
you should better check InfoMessage()
Re: Server crashes when player takes damage -
TakeiT - 10.01.2016
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
Re: Server crashes when player takes damage -
yvoms - 10.01.2016
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
If(amount !=0)
{
InfoMessage(playerid, "YOU GOT SHOT!");
}
return 1;
}
Re: Server crashes when player takes damage -
TakeiT - 10.01.2016
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/
Re: Server crashes when player takes damage -
itsCody - 10.01.2016
What happens if you put
PHP код:
if(issuerid != INVALID_PLAYER_ID) InfoMessage(playerid, "YOU GOT SHOT!");
Re: Server crashes when player takes damage -
TakeiT - 10.01.2016
Quote:
Originally Posted by itsCody
What happens if you put
PHP код:
if(issuerid != INVALID_PLAYER_ID) InfoMessage(playerid, "YOU GOT SHOT!");
|
Nothing.
Re: Server crashes when player takes damage -
itsCody - 10.01.2016
I feel like it's to do with something in InfoMessage, though you say you're formatting SendClientMessage. Something could be conflicting?
Re: Server crashes when player takes damage -
TakeiT - 10.01.2016
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.
Re: Server crashes when player takes damage -
Mauzen - 10.01.2016
Any hooked OnPlayerTakeDamage callbacks?
Else compile it with debug symbols to get exact information and line numbers.
It probably is InfoMessage though.