21.03.2019, 06:10
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
CODE:
Quote:
|
PHP код:
PKed(playerid, reason)
{
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(playerid, 1);
}
SetPlayerSpawn(playerid)
{
if(IsPlayerConnected(playerid))
{
if(pInfo[playerid][pInjured] == 1)
{
ShowPlayerBloodScreen(playerid, BLOOD_TYPE_1);
if(pInfo[playerid][pTempSkin] > 0)
{
SetPlayerSkin(playerid, pInfo[playerid][pTempSkin]);
}
else
{
SetPlayerSkin(playerid, pInfo[playerid][pSkin]);
}
SCM(playerid, COLOR_LIGHTRED, "INJURED: {FFFFFF}You're injured. type /forcedeath to force respawn in hospital");
SetPlayerPos(playerid, pInfo[playerid][DeathX], pInfo[playerid][DeathY], pInfo[playerid][DeathZ]);
SetPlayerVirtualWorld(playerid, pInfo[playerid][DeathVW]);
SetPlayerInterior(playerid, pInfo[playerid][DeathInt]);
//ClearAnimations(playerid);
//SetPlayerHealth(playerid, 9999);
SetPlayerHealth(playerid, Float:0x7FFFFFFF);
SetPlayerArmour(playerid,0);
ClearAnimations(playerid);
ApplyAnimation(playerid, "PED", "KO_SKID_FRONT", 4.0, 0, 1, 1, 1, 0, 1);
TogglePlayerControllable(playerid, 0);
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SpawnPlayer(playerid);
GetPlayerPos(playerid, pInfo[playerid][DeathX], pInfo[playerid][DeathY], pInfo[playerid][DeathZ]);
pInfo[playerid][DeathVW] = GetPlayerVirtualWorld(playerid);
pInfo[playerid][DeathInt] = GetPlayerInterior(playerid);
sweeper = 0;
SetPlayerColor(playerid, COLOR_CIVIL);
Player_ResetCutting(playerid);
Player_DropLog(playerid, 1);
//SetPlayerHealth(playerid, 100);
SetPlayerHealth(playerid, 9999);
if(pInfo[playerid][pInjured] == 1)
{
PKed(playerid, 2);
}
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(playerid, pInfo[playerid][pInterior]);
SetPlayerPos(playerid, pInfo[playerid][X_Pos], pInfo[playerid][Y_Pos], pInfo[playerid][Z_Pos]);
SetPlayerFacingAngle(playerid, pInfo[playerid][A_Pos]);
SetCameraBehindPlayer(playerid);
/* HOUSE OPS */
InHouse[playerid] = INVALID_HOUSE_ID;
new query[250];
mysql_format(g_SQL, query, sizeof(query), "SELECT * FROM housesales WHERE OldOwner='%e'", GetName(playerid));
mysql_tquery(g_SQL, query, "HouseSaleMoney", "i", playerid);
//====================================================================================================================================================
/* BUSINESS OPS */
InBusiness[playerid] = INVALID_BUSINESS;
mysql_format(g_SQL, query, sizeof(query), "SELECT * FROM business_transactions WHERE OldOwner='%e'", GetName(playerid));
mysql_tquery(g_SQL, query, "BusinessSaleMoney", "i", playerid);
//===================================================================================================================================================
if(pInfo[playerid][pMuted] == true)
{
SendClientMessageEx(playerid, COLOR_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(playerid, COLOR_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;
}