OnPlayerDeath has no effect in filterscript -
HurtLocker - 19.05.2013
I use this little code to store kills/deaths in enums and use them onplayerdisconnect. But nothing happens. I added the sendclientmessage to be sure whether the problem is in disconnect function or in file writing. I do not receive the yes message so title says it all. Yes, in server.cfg file I have written first the fs that contains this, its the reglog fs. Any idea?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerStats[killerid][Kills]++;
PlayerStats[playerid][Deaths]++;
SendClientMessage(playerid, 1, "yes");
return 1;
}
Re: OnPlayerDeath has no effect in filterscript -
Pillhead2007 - 19.05.2013
try this
Quote:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerStats[killerid][Kills]++;
PlayerStats[playerid][Deaths]++;
SendClientMessage(playerid, -1, "yes");
return 1;
}
|
Re: OnPlayerDeath has no effect in filterscript -
Avi Raj - 19.05.2013
use this :-
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerStats[killerid][Kills]++;
PlayerStats[playerid][Deaths]++;
SendClientMessage(killerid, -1, "yes");
return 1;
}
AW: OnPlayerDeath has no effect in filterscript -
HurtLocker - 19.05.2013
Both of you are you joking? I just suicide to test it so theres no reason to turn playerid to killerid inside scm. And receiveing the "yes" is not the point nor my goal, it's just an indicator that tells me: "onplayerdeath does get triggered!"
Re: OnPlayerDeath has no effect in filterscript -
Pillhead2007 - 19.05.2013
doesn't really matter scm is there to see if its working isn't it as test field , if you killed yourself and playerid is in scm then u get the msg and enums should stack up why don't u try killing yourself checking the user files .ini and see if the deaths are written and writing
AW: Re: OnPlayerDeath has no effect in filterscript -
HurtLocker - 19.05.2013
Quote:
Originally Posted by Pillhead2007
doesn't really matter scm is there to see if its working isn't it as test field , if you killed yourself and playerid is in scm then u get the msg and enums should stack up why don't u try killing yourself checking the user files .ini and see if the deaths are written and writing
|
One thing: Stop posting nonsense. Of cource I checked .ini file and then came here to ask for help.
Re: OnPlayerDeath has no effect in filterscript -
[WSF]ThA_Devil - 19.05.2013
try replacing color with 0xFFFFFFAA
AW: OnPlayerDeath has no effect in filterscript -
HurtLocker - 19.05.2013
Quote:
Originally Posted by [WSF]ThA_Devil
try replacing color with 0xFFFFFFAA
|
omg man i said theres nothing wrong with that, you blind?
Quote:
Originally Posted by HurtLocker
Receiveing the "yes" is not the point nor my goal, it's just an indicator that tells me: "onplayerdeath does get triggered!"
|
Re: OnPlayerDeath has no effect in filterscript -
Avi Raj - 19.05.2013
Show your OnPlayerDisconnect.
AW: OnPlayerDeath has no effect in filterscript -
HurtLocker - 19.05.2013
All other values do get saved so there's nothing wrong with that. Look:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if (PlayerStats[playerid][Logged]==1)
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Money", GetPlayerMoney(playerid));
INI_WriteInt(File,"Score", GetPlayerScore(playerid));
INI_WriteInt(File,"Kills", PlayerStats[playerid][Kills]);
INI_WriteInt(File,"Deaths", PlayerStats[playerid][Deaths]);
INI_WriteFloat(File,"Ratio", float(PlayerStats[playerid][Kills])/float(PlayerStats[playerid][Deaths]));
INI_WriteInt(File,"Logged", 0);
INI_Close(File);
}
return 1;
}