[HELP] Death Bug
#1

So, I want to make after the player dies, will return to the position where he died with injured status. But what happens instead is that the player is sent to the blueberry chord, and sends "You're injured ..." continuously

Quote:

CODE:

PHP код:
PKed(playeridreason)
{
    if(
reason == 1)
    {
        
SetPVarInt(playerid"forcedeath"0);
    }
    if(
reason == 2)
    {
    }
    
pInfo[playerid][pInjured] = 0;
    
pInfo[playerid][pHS] = 0;
    
pInfo[playerid][pTS] = 0;
    
pInfo[playerid][pGS] = 0;
    
pInfo[playerid][pLAS] = 0;
    
pInfo[playerid][pRAS] = 0;
    
pInfo[playerid][pLLS] = 0;
    
pInfo[playerid][pRLS] = 0;
    
incccLowerBlood(playerid);
    
cmd_sendtols(playerid"");
    
TogglePlayerControllable(playerid1);
}
SetPlayerSpawn(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
pInfo[playerid][pInjured] == 1)
        {
            
ShowPlayerBloodScreen(playeridBLOOD_TYPE_1);
            if(
pInfo[playerid][pTempSkin] > 0)
            {
                
SetPlayerSkin(playeridpInfo[playerid][pTempSkin]);
            }
            else
            {
                
SetPlayerSkin(playeridpInfo[playerid][pSkin]);
            }
            
SCM(playeridCOLOR_LIGHTRED"INJURED: {FFFFFF}You're injured. type /forcedeath to force respawn in hospital");
            
SetPlayerPos(playeridpInfo[playerid][DeathX], pInfo[playerid][DeathY], pInfo[playerid][DeathZ]);
            
SetPlayerVirtualWorld(playeridpInfo[playerid][DeathVW]);
            
SetPlayerInterior(playeridpInfo[playerid][DeathInt]);
            
//ClearAnimations(playerid);
            //SetPlayerHealth(playerid, 9999);
            
SetPlayerHealth(playeridFloat:0x7FFFFFFF);
            
SetPlayerArmour(playerid,0);
            
ClearAnimations(playerid);
            
ApplyAnimation(playerid"PED""KO_SKID_FRONT"4.0011101);
            
TogglePlayerControllable(playerid0);
        }
    }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
SpawnPlayer(playerid);
    
GetPlayerPos(playeridpInfo[playerid][DeathX], pInfo[playerid][DeathY], pInfo[playerid][DeathZ]);
    
pInfo[playerid][DeathVW] = GetPlayerVirtualWorld(playerid);
    
pInfo[playerid][DeathInt] = GetPlayerInterior(playerid);
    
sweeper 0;
    
SetPlayerColor(playeridCOLOR_CIVIL);
    
Player_ResetCutting(playerid);
    
Player_DropLog(playerid1);
    
//SetPlayerHealth(playerid, 100);
    
SetPlayerHealth(playerid9999);
    if(
pInfo[playerid][pInjured] == 1)
    {
        
PKed(playerid2);
    }
    
pInfo[playerid][pInjured] = 1;
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
//====================================================================================================================================================
    // spawn the player to their last saved position
    //mysql_format(g_SQL, query, sizeof query, "SELECT * FROM `x` = %f, `y` = %f, `z` = %f, `angle` = %f, `interior` = %d WHERE `id` = %d LIMIT 1", pInfo[playerid][X_Pos], pInfo[playerid][Y_Pos], pInfo[playerid][Z_Pos], pInfo[playerid][A_Pos], pInfo[playerid][pInterior], pInfo[playerid][ID]);
    
SetPlayerInterior(playeridpInfo[playerid][pInterior]);
    
SetPlayerPos(playeridpInfo[playerid][X_Pos], pInfo[playerid][Y_Pos], pInfo[playerid][Z_Pos]);
    
SetPlayerFacingAngle(playeridpInfo[playerid][A_Pos]);
    
SetCameraBehindPlayer(playerid);
    
/* HOUSE OPS */
    
InHouse[playerid] = INVALID_HOUSE_ID;
    
    new 
query[250];
    
mysql_format(g_SQLquerysizeof(query), "SELECT * FROM housesales WHERE OldOwner='%e'"GetName(playerid));
    
mysql_tquery(g_SQLquery"HouseSaleMoney""i"playerid);
    
//====================================================================================================================================================
    /* BUSINESS OPS */
    
InBusiness[playerid] = INVALID_BUSINESS;
    
    
mysql_format(g_SQLquerysizeof(query), "SELECT * FROM business_transactions WHERE OldOwner='%e'"GetName(playerid));
    
mysql_tquery(g_SQLquery"BusinessSaleMoney""i"playerid);
    
//===================================================================================================================================================
    
if(pInfo[playerid][pMuted] == true)
    {
        
SendClientMessageEx(playeridCOLOR_TOMATO"You are currently muted. You have %i minutes left for your mute to be gone."pInfo[playerid][pMutedTime] / 60);
    }
    if(
pInfo[playerid][pJailed] == true)
    {
        
SendClientMessageEx(playeridCOLOR_TOMATO"You are currently jailed. You have %i minutes left for you to be released."pInfo[playerid][pJailedTime] / 60);
    }
    
SetPlayerSpawn(playerid); // THIS THIS THIS THIS
    
return 1;

Reply


Messages In This Thread
[HELP] Death Bug - by KinxpIn - 21.03.2019, 06:10
Re: [HELP] Death Bug - by KinxpIn - 21.03.2019, 07:30
Re: [HELP] Death Bug - by Kaliber - 21.03.2019, 08:46
Re: [HELP] Death Bug - by KinxpIn - 21.03.2019, 09:07

Forum Jump:


Users browsing this thread: 1 Guest(s)