OnPlayerDeath has no effect in filterscript
#1

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;
}
Reply
#2

try this
Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
PlayerStats[killerid][Kills]++;
PlayerStats[playerid][Deaths]++;
SendClientMessage(playerid, -1, "yes");
return 1;
}

Reply
#3

use this :-
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerStats[killerid][Kills]++;
    PlayerStats[playerid][Deaths]++;
    SendClientMessage(killerid, -1, "yes");
    return 1;
}
Reply
#4

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!"
Reply
#5

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

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

try replacing color with 0xFFFFFFAA
Reply
#8

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!"
Reply
#9

Show your OnPlayerDisconnect.
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)