17.12.2018, 16:34
Does anyone have the solution to my problem? It happens that sometimes when some player dies, it just does not die, it gets bugged with CJ there in bluebarry, I do not use RequestClass and RequestSpawn because I have a custom kill screen with TXD, but it worked perfectly when I ran the server on the PC, it was only up in HOST and started to give this problem with some players
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
WeaponDemageValue = randomEx(15, 65);
sangramentoporcent = randomEx(10, 90);
if(GetTickCountDifference(GetTickCount(), death_LastDeath[playerid]) < 1000)
return -1;
death_LastDeath[playerid] = GetTickCount();
if(killerid == INVALID_PLAYER_ID)
{
killerid = GetLastHitById(playerid);
if(!IsPlayerConnected(killerid))
killerid = INVALID_PLAYER_ID;
}
_OnDeath(playerid, killerid);
PlayerTextDrawDestroy(playerid,txtDateDisp22);
return 1;
}
_OnDeath(playerid, killerid)
{
if(IsPlayerVIP(killerid))
{
new STR[250];
SetPlayerScore(killerid, GetPlayerScore(killerid) +2);
format(STR, 50, "%d", GetPlayerScore(killerid));
PlayerTextDrawShow(killerid, TextHUD[killerid][2]);
PlayerTextDrawSetString(killerid, TextHUD[killerid][2], STR);
}
else
{
new STR[250];
SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
format(STR, 50, "%d", GetPlayerScore(killerid));
PlayerTextDrawShow(killerid, TextHUD[killerid][2]);
PlayerTextDrawSetString(killerid, TextHUD[killerid][2], STR);
}
if(IsPlayerOnAdminDuty(playerid))
{
return 0;
}
new
deathreason = GetLastHitByWeapon(playerid),
deathreasonstring[256];
SetPlayerBitFlag(playerid, Dying, true);
SetPlayerBitFlag(playerid, Spawned, false);
SetPlayerBitFlag(playerid, Alive, false);
GetPlayerPos(playerid, death_PosX[playerid], death_PosY[playerid], death_PosZ[playerid]);
GetPlayerFacingAngle(playerid, death_RotZ[playerid]);
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
death_PosZ[playerid] += 0.5;
}
HideWatch(playerid);
DropItems(playerid, death_PosX[playerid], death_PosY[playerid], death_PosZ[playerid], death_RotZ[playerid], true);
RemovePlayerWeapon(playerid);
SpawnPlayer(playerid);
ToggleArmour(playerid, false);
KillPlayer(playerid, killerid, deathreason);
}