SA-MP Forums Archive
OnPlayerDeath is not getting called - 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: OnPlayerDeath is not getting called (/showthread.php?tid=607772)



OnPlayerDeath is not getting called - MichiEXE - 23.05.2016

Whether in a filterscript nor in my gamemode..
I wrote this under OnPlayerDeath:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	printf("1");
	PlayerTextDrawSetString(playerid, HudTd[playerid][29], "0%");
	Tot[playerid]=true;
	pInfo[playerid][survivaltime]=-1;
	SurvivalCount(playerid);
	for(new i=0; i<38; i++)
	{
		pInventar[playerid][i]=-1;
	}
	return 1;
}
Not even the "1" is "printed". Nothing happens. Same with a filterscript.
The crashdetect plugin also "printed" nothing.

All my includes i use don't use OnPlayerDeath in any way - so what is causing this?
My first thought was OnPlayerTakeDamage, so i commented it out but nothing changed.

Plugins i use: FCNPC, MapAndreas, streamer, mysql, crashdetect

Does somebody know whats going on with my gamemode or whatever is causing this?


Re: OnPlayerDeath is not getting called - 1fret - 23.05.2016

Quote:
Originally Posted by MichiEXE
Посмотреть сообщение
Whether in a filterscript nor in my gamemode..
I wrote this under OnPlayerDeath:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	printf("1");
	PlayerTextDrawSetString(playerid, HudTd[playerid][29], "0%");
	Tot[playerid]=true;
	pInfo[playerid][survivaltime]=-1;
	SurvivalCount(playerid);
	for(new i=0; i<38; i++)
	{
		pInventar[playerid][i]=-1;
	}
	return 1;
}
Not even the "1" is "printed". Nothing happens. Same with a filterscript.
The crashdetect plugin also "printed" nothing.

All my includes i use don't use OnPlayerDeath in any way - so what is causing this?
My first thought was OnPlayerTakeDamage, so i commented it out but nothing changed.

Plugins i use: FCNPC, MapAndreas, streamer, mysql, crashdetect

Does somebody know whats going on with my gamemode or whatever is causing this?
Im not sure if this is the issue but it seems to always work:

1. make sure you have the right plugins(.dll for windows and .so for linux)

2.Make sure you have the lastest includes are downloaded and make sure you #include<> in the server at the top of the script.

3, Could you show use the server.cfg file please

N.B
As i have stated those are some simple mistakes made by other scripters so please dont rage out as i am just give you a few suggestions to check.


Re: OnPlayerDeath is not getting called - MichiEXE - 23.05.2016

Plugins are allright, and the includes i use work all in other gamemodes where OnPlayerDeath is being called.

Код:
echo Executing Server Config...
lanmode 0
rcon_password ******
maxplayers 500
port 7777
hostname server name here
gamemode0 gamemode 1
filterscripts 
announce 0
chatlogging 0
weburl www.urlhere.de
onfoot_rate 40
plugins crashdetect mysql streamer FCNPC MapAndreas
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 300
logtimeformat [%H:%M:%S]
language German / Deutsch