When player died problem.
#1

Whenever a player dies, it's like randomly happens the player gets stuck and he won't respawn, only if someone else will shot him once again.

Here's my OnPlayerDeath function:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != playerid)
    {
        new str[128];
        WepLevel[ killerid ] ++;
        Kills[ killerid ] ++;
        Kills[ playerid ] = 0;
        SetPlayerHealth( killerid, 100.0 );
        if(Kills[ killerid ] == 5 || Kills[ killerid ] == 10 || Kills[ killerid ] == 15)
        {
            SendClientMessage( killerid, COLOR_LIGHTGREEN, "You've gained some extra health and armour!");
            SetPlayerHealth( killerid, 100.0 );
            SetPlayerArmour( killerid, 100.0 );
        }
        TextDrawShowForPlayer(playerid, KillDieDraw[playerid]);
        TextDrawShowForPlayer(killerid, KillDieDraw[killerid]);
        format(str, sizeof(str), "~p~You have been killed by ~y~%s", GetNameEx(killerid));
        TextDrawSetString(KillDieDraw[playerid], str);
        format(str, sizeof(str), "~p~You have just killed ~y~%s", GetNameEx(playerid));
        TextDrawSetString(KillDieDraw[killerid], str);
        SetPVarInt(playerid, "KillDieDraw", 5);
        SetPVarInt(killerid, "KillDieDraw", 5);
        if( GetPlayerWeapon( killerid ) == 4 )
        {
            if( WepLevel[ playerid ] != 1)
            {
                SendClientMessage( playerid, COLOR_LIGHTBLUE, "*** You have leveled down! you've died by a knife ***" );
                WepLevel[ playerid ] --;
            }
        }
        GiveWeaponByLevel( killerid );
    }
    SetPVarInt(playerid, "HasDied", 1);
    return 1;
}
Reply


Messages In This Thread
When player died problem. - by PaulDinam - 02.09.2013, 22:59
Re: When player died problem. - by Borg - 02.09.2013, 23:45
Re: When player died problem. - by PaulDinam - 03.09.2013, 05:47
Re: When player died problem. - by Skribblez - 03.09.2013, 06:07
Re: When player died problem. - by PaulDinam - 03.09.2013, 06:19
Re: When player died problem. - by Skribblez - 03.09.2013, 06:33
Re: When player died problem. - by PaulDinam - 03.09.2013, 06:36
Re: When player died problem. - by Skribblez - 03.09.2013, 06:40
Re: When player died problem. - by PaulDinam - 03.09.2013, 06:51
Re: When player died problem. - by Skribblez - 03.09.2013, 06:54

Forum Jump:


Users browsing this thread: 1 Guest(s)