14.05.2016, 00:06
Title says all.
The player can fall, be shot, stabbed etc and they will respawn correctly in the death system. However, if the cause is an explosion the player is prompted with the (SPAWN) button which shouldn't happen.
Here is my death system:
Player is dead..
RESOLVED.
The player can fall, be shot, stabbed etc and they will respawn correctly in the death system. However, if the cause is an explosion the player is prompted with the (SPAWN) button which shouldn't happen.
Here is my death system:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerDead[playerid] = 1;
pawn Код:
public OnPlayerUpdate(playerid)
{
if(PlayerDead[playerid] == 1 && PlayerIsDead[playerid] == 0)
{
PlayerDeath(playerid);
}
pawn Код:
stock PlayerDeath(playerid)
{
SetPlayerVirtualWorld(playerid, DeathVW[playerid]);
SetPlayerInterior(playerid, DeathInt[playerid]);
SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
SetPlayerHealth(playerid, 99999);
new model, GunAmmo, sqlid;
new string[128];
PlayerIsDead[playerid] = 1;
format(string, sizeof(string), "D E A D\nB O D Y");
DeathLabel[playerid] = CreateDynamic3DTextLabel(string, COLOUR_REALRED, 0.0, 0.0, -0.5, 50.0, playerid, INVALID_VEHICLE_ID);
format(string, sizeof(string), "You have "COL_RED"died."COL_WHITE" Please assist players with the use of "COL_GREEN"'/do' "COL_WHITE"and do not "COL_RED"RK.");
SendClientMessage(playerid, COLOUR_WHITE, string);
SendClientMessage(playerid, COLOUR_GREY, "Depending on your cause of death, you may be revived. You must wait 3 minutes before you can '/accept death', EMT's have 4 minutes to respond before you cannot be revived.");
TextDrawShowForPlayer(playerid, DeadDraw[playerid]);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 0, 1);
DeathTimer[playerid] = 3;
TextDrawHideForPlayer(playerid,BFText);
KillTimer(BleedingTime[playerid]);
PlayerDead[playerid] = 0;
/*new Float: area[5];
area[0] = 0.1;
area[1] = 0.2;
area[2] = 0.3;
area[3] = 0.4;
area[4] = 0.5;
*/
for(new w = 0; w < 13; w++)
{
if(PlayerWeapons[playerid][w] > 0)
{
sqlid = PlayerWeapons[playerid][w];
model = WepModel[sqlid];
GunAmmo = WepAmmo[sqlid];
DropGun(playerid, sqlid, model,GunAmmo,DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid] ,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
}
}
return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(PlayerDead[playerid] == 1 || PlayerIsDead[playerid])return 1;
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(LoggedIn[playerid] == 0) return 0;
if(PlayerDead[playerid] == 1 || PlayerIsDead[playerid])return 1;