Death Bug . -
Hello guys , I have a RP server and there is a bug in the death system , When someone die it should appear infront of him the /accept death and /serverice ems , But now when someone die it takes him instantly to the hospital so how can I fix that .
Re: Death Bug . -
Try to repair the script. I would start with OnPlayerDeath callback
Re: Death Bug . -
Here is the part of the death system , What should I fix in it to fix that problem ?
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
new hour,minute,second, weaponname[32];
gettime(hour,minute,second);
FixHour(hour);
hour = shifthour;
GetWeaponName(reason, weaponname, sizeof(weaponname));
format(PlayerInfo[playerid][pKillLog9], 256, "%s", PlayerInfo[playerid][pKillLog8]);
format(PlayerInfo[playerid][pKillLog8], 256, "%s", PlayerInfo[playerid][pKillLog7]);
format(PlayerInfo[playerid][pKillLog7], 256, "%s", PlayerInfo[playerid][pKillLog6]);
format(PlayerInfo[playerid][pKillLog6], 256, "%s", PlayerInfo[playerid][pKillLog5]);
format(PlayerInfo[playerid][pKillLog5], 256, "%s", PlayerInfo[playerid][pKillLog4]);
format(PlayerInfo[playerid][pKillLog4], 256, "%s", PlayerInfo[playerid][pKillLog3]);
format(PlayerInfo[playerid][pKillLog3], 256, "%s", PlayerInfo[playerid][pKillLog2]);
format(PlayerInfo[playerid][pKillLog2], 256, "%s", PlayerInfo[playerid][pKillLog1]);
format(PlayerInfo[playerid][pKillLog1], 256, "%s", PlayerInfo[playerid][pKillLog0]);
format(PlayerInfo[playerid][pKillLog0], 256, "(%d:%d:%d) %s killed me with %s", hour,minute,second,GetPlayerNameEx(killerid), weaponname);
format(PlayerInfo[killerid][pKillLog9], 256, "%s", PlayerInfo[killerid][pKillLog8]);
format(PlayerInfo[killerid][pKillLog8], 256, "%s", PlayerInfo[killerid][pKillLog7]);
format(PlayerInfo[killerid][pKillLog7], 256, "%s", PlayerInfo[killerid][pKillLog6]);
format(PlayerInfo[killerid][pKillLog6], 256, "%s", PlayerInfo[killerid][pKillLog5]);
format(PlayerInfo[killerid][pKillLog5], 256, "%s", PlayerInfo[killerid][pKillLog4]);
format(PlayerInfo[killerid][pKillLog4], 256, "%s", PlayerInfo[killerid][pKillLog3]);
format(PlayerInfo[killerid][pKillLog3], 256, "%s", PlayerInfo[killerid][pKillLog2]);
format(PlayerInfo[killerid][pKillLog2], 256, "%s", PlayerInfo[killerid][pKillLog1]);
format(PlayerInfo[killerid][pKillLog1], 256, "%s", PlayerInfo[killerid][pKillLog0]);
format(PlayerInfo[killerid][pKillLog0], 256, "(%d:%d:%d) Killed %s with %s", hour,minute,second,GetPlayerNameEx(playerid), weaponname);
if(GetPVarInt(killerid, "IsInArena") == 0) PlayerInfo[killerid][pDMKills]++;
}
new string[128];
pTazer[playerid] = 0;
InsideShamal[playerid] = INVALID_VEHICLE_ID;
DeletePVar(playerid, "SpeedRadar");
DeletePVar(playerid, "UsingSprunk");
KillTimer(GetPVarInt(playerid, "firstaid5"));
DeletePVar(playerid, "usingfirstaid");
if(GetPVarInt(playerid, "MovingStretcher") != -1)
{
KillTimer(GetPVarInt(playerid, "TickEMSMove"));
DeletePVar(GetPVarInt(playerid, "MovingStretcher"), "OnStretcher");
SetPVarInt(playerid, "MovingStretcher", -1);
}
new caller = Mobile[playerid];
if(IsPlayerConnected(Mobile[playerid]))
{
SendClientMessageEx(caller, COLOR_GRAD2, "The line went dead.");
format(string, sizeof(string), "* %s puts away their cellphone.", GetPlayerNameEx(caller));
ProxDetector(30.0, caller, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[caller] = 0;
Mobile[caller] = INVALID_PLAYER_ID;
}
Mobile[playerid] = INVALID_PLAYER_ID;
CellTime[playerid] = 0;
RingTone[playerid] = 0;
foreach(Player, i)
{
if(EMSAccepted[i] < 999)
{
if(EMSAccepted[i] == playerid)
{
EMSAccepted[i] = 999;
GameTextForPlayer(i, "~w~EMS Caller~n~~r~Has Died", 5000, 1);
EMSCallTime[i] = 0;
DisablePlayerCheckpoint(i);
}
}
}
if( GetPVarInt(playerid, "SpecOff" ) == 1 )
{
SpawnPlayer(playerid);
return 1;
}
if(GetPVarInt(playerid, "s") == 1)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You appear to be stuck in limbo, medics are trying to revive you.");
KillEMSQueue(playerid);
ResetPlayerWeaponsEx(playerid);
Re: Death Bug . -
Re: Death Bug . -
There is a timer but there is something wrong with it , How can I fix it ?
Re: Death Bug . -
Re: Death Bug . -
Re: Death Bug . -
So is there a problem in the lines I posted or the problem in another part ?
Re: Death Bug . -
Код:
GameTextForPlayer(playerid, "~r~Injured~n~~w~/accept death or /service ems", 5000, 3);
ClearAnimations(playerid);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,0);
if(GetPVarInt(playerid, "usingfirstaid") == 1)
{
firstaidexpire(playerid);
}
SetPVarInt(playerid,"MedicCall",1);
}
case 2:
{
SetPVarInt(playerid,"EMSAttempt", 2);
ClearAnimations(playerid);
ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,0);
}
Re: Death Bug . -