OnPlayerDeath Not getting called.
#6

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][Kills]++;
    PlayerInfo[playerid][Deaths]++;
    SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
    OnWeaponDrop(playerid);
    SendClientMessage(playerid, -1, "I am called.");
    if(killerid != TopKiller)
    {
        TopKiller = killerid;
        TopKills = 0;
    }
    TopKills++;
    if(TopKills == 5)
    {
        new String[128];
        format(String,sizeof(String),"You have filled the kills board with your name and recived a 25000$ bonus!");
        SendClientMessage(playerid,0xFF0000DD,String);
        GivePlayerMoney(killerid,25000);
        TopKills = 0;
    }
   
    if(playerid == CashboxOwner)
    {
        new str[128], pName[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "Cashbox-Owner %s (ID: %d) has died and droped the cashbox!", pName, playerid);
        SendClientMessageToAll(0xFFD700AA, str);
        CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);

        CashboxOwner = INVALID_PLAYER_ID;
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    SetPlayerCheckpoint(i, CashboxX, CashboxY, CashboxZ, 1);
                }
            }
        }
    }
   
    if(PlayerInfo[playerid][InDerby] == 1)
    {
        SendFMessageToAll(COL_RED,"« Derby » "CBLUE"%s has died while in the derby!",PlayerName(playerid));
        derbyplayers--;
        PlayerInfo[playerid][InDerby] = 0;
    }
   
       
    if(Joined[playerid] == true)
    {
        JoinCount--;
        Joined[playerid] = false;
        DestroyVehicle(CreatedRaceVeh[playerid]);
        DisablePlayerRaceCheckpoint(playerid);
        TextDrawHideForPlayer(playerid, RaceInfo[playerid]);
        TextDrawHideForPlayer(playerid, RaceBox);
        TextDrawHideForPlayer(playerid, RaceLogo);
        TextDrawHideForPlayer(playerid, RaceOut1);
        TextDrawHideForPlayer(playerid, RaceOut2);
        CPProgess[playerid] = 0;
        KillTimer(InfoTimer[playerid]);
        #if defined RACE_IN_OTHER_WORLD
        SetPlayerVirtualWorld(playerid, 0);
        #endif
    }
    if(BuildRace == playerid+1) BuildRace = 0;

   
    return 1;
}
This is my onplayerdeath code and when i die myself death won't increase i am serisouly not getting your point friend because i haven't met this problem before.
Reply


Messages In This Thread
OnPlayerDeath Not getting called. - by Black Wolf - 15.01.2013, 16:34
Re : OnPlayerDeath Not getting called. - by Vukilore - 15.01.2013, 16:45
Re: Re : OnPlayerDeath Not getting called. - by Black Wolf - 15.01.2013, 16:49
Re: OnPlayerDeath Not getting called. - by [KHK]Khalid - 15.01.2013, 18:03
Re: Re : OnPlayerDeath Not getting called. - by leong124 - 15.01.2013, 18:59
Re: OnPlayerDeath Not getting called. - by Black Wolf - 16.01.2013, 03:37
Re: OnPlayerDeath Not getting called. - by TopFuel - 16.01.2013, 03:40
Re: OnPlayerDeath Not getting called. - by Black Wolf - 16.01.2013, 04:01
Re: OnPlayerDeath Not getting called. - by Jochemd - 16.01.2013, 05:10
Re : Re: OnPlayerDeath Not getting called. - by decondelite - 16.01.2013, 07:47

Forum Jump:


Users browsing this thread: 1 Guest(s)