SA-MP Forums Archive
After Death - 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: After Death (/showthread.php?tid=650391)



After Death - DeMoo - 26.02.2018

player can walk after death any idea how to fix this?


Re: After Death - Mike861 - 26.02.2018

Show OnPlayerDeath


Re: After Death - cuber - 26.02.2018

You should provide some code... how are we supposed to know that?


Re: After Death - kingmk - 26.02.2018

Quote:
Originally Posted by DeMoo
Посмотреть сообщение
player can walk after death any idea how to fix this?
This it's because you do something wrong on OnPlayerDeath(), most of cases, peope don't check if the killerid != INVALID_PLAYER_ID, and the OnPlayerDeath will stuck, so the player who dies will can walk....

Another reason, it's your server. Your server may be lagging some times, and makes this problem.

Show us your OnPlayerDeath() so we can figure out.


Re: After Death - RogueDrifter - 26.02.2018

Quote:
Originally Posted by kingmk
Посмотреть сообщение
This it's because you do something wrong on OnPlayerDeath(), most of cases, peope don't check if the killerid != INVALID_PLAYER_ID, and the OnPlayerDeath will stuck, so the player who dies will can walk....

Another reason, it's your server. Your server may be lagging some times, and makes this problem.

Show us your OnPlayerDeath() so we can figure out.
Wait
Quote:

most of cases, peope don't check if the killerid != INVALID_PLAYER_ID,

What? Hows that going to affect anything rather make the player walk??

Id say this guy used ClearAnimations once death occurs


Re: After Death - DeMoo - 27.02.2018

PHP код:
    PlayerInfo[playerid][pAFKTime] = -3;
    
ClearAnimations(playerid);
    
KillTimer(HalfSecTimer[playerid]);
    
DestroyPlayerObject(playerid,CheatText[playerid]);
    if(
killerid != INVALID_PLAYER_ID)
    {
        if(
DamageTaken[playerid] == 0)
        {
            
Cheater(playerid"Fake Kill",1);
        }
    }
    if(
killerid == playerid)
    {
       
Cheater(playerid"Fake Kill",1);
    }
    if(
DamageTaken[playerid] == 1)
    {
       
SetTimerEx("DamageTimer"10false"i"playerid);
    }
    new 
str[512],gname[64];
    if(
shesulia[playerid] && dawyebulia)
    {
        if(
killerid != INVALID_PLAYER_ID)
        {
            
PlayerInfo[killerid][pKills]++;
            
TempKill[killerid] ++;
            
SendDeathMessage(killeridplayeridreason);
            
KilledManID[killerid] = playerid;
            
GetWeaponName(reasongnamesizeof(gname));
            
StatusCheck[playerid] = false;
            if(
reason >= 22 && reason 39)
            {
                
format(str,sizeof(str),"~n~~n~~n~~n~~n~~w~YOU have killed %s with %s~n~~r~%d kill",GetName(playerid),gname,TempKill[killerid]);
            }
            else 
format(str,sizeof(str),"~n~~n~~n~~n~~n~~w~YOU have killed %s~n~~r~%d kill",GetName(playerid),TempKill[killerid]);
            
TD_MSG(killerid3000str);
        }
        else
        {
            
SendDeathMessage(playeridplayeridreason);
        }
        
// Iaragis Dagdeba Sikvdilis Shemdeg //
        
new weaponid GetPlayerWeapon(playerid);
        new 
wammo GetPlayerAmmo(playerid);
        if(
weaponid && weaponid 39)
        {
            
DropWeaponsDeath(playerid,weaponid,wammo);
        }
        
//
         
PlayerInfo[playerid][pDeaths]++, lmsCount--;
        
shesulia[playerid] = 0;
        
//GangZoneHideForPlayer(playerid,deathzone);
        
GZ_ShapeHideForPlayer(playeriddeathzone);
        
hppack[playerid] = 0;
        
StatusCheck[playerid] = false;
        
PlayerTextDrawHide(playeridPlayerText:IGStatus[0][playerid]);
        
PlayerTextDrawHide(playeridPlayerText:IGStatus[1][playerid]);
        
PlayerTextDrawHide(playeridPlayerText:IGStatus[2][playerid]);
        
PlayerTextDrawHide(playeridPlayerText:IGStatus[3][playerid]);
    }
    else
    {
        if(
killerid == INVALID_PLAYER_ID) return 1;
        new 
formattxt[512];
        
format(formattxt,512,"~w~YOU have killed ~r~%s",GetName(playerid));
        
TD_MSG(killerid3000formattxt);
        
format(formattxt,512,"~w~YOU were killed by ~r~%s",GetName(killerid));
        
TD_MSG(playerid3000formattxt);
    }
    return 
1;




Re: After Death - PepsiCola23 - 27.02.2018

remove
PHP код:
    ClearAnimations(playerid); 
from OnPlayerDeath


Re: After Death - RogueDrifter - 27.02.2018

I called it! lol!


Re: After Death - DeMoo - 27.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
remove
PHP код:
    ClearAnimations(playerid); 
from OnPlayerDeath
I tried it already


Re: After Death - kingmk - 27.02.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Wait

What? Hows that going to affect anything rather make the player walk??

Id say this guy used ClearAnimations once death occurs
Yes, OnPlayerDeath will stuck if don't check the killerid it's equals with INVALID_PLAYER_ID, and u use killerid in a array...

put this on your OnPlayerDeath()

Код:
if(killderid == INVALID_PLAYER_ID) return 1;