SA-MP Forums Archive
Death bug. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Death bug. (/showthread.php?tid=624162)



Death bug. - toxicape - 11.12.2016

Well when someone dies in my server it sends them straight to hospital even if FD is on duty.


Re: Death bug. - BiosMarcel - 11.12.2016

Let me tell you, noone on this website is a wizard, dunno if u knew that, but we can't help you if you don't give us code.

But anyways, please read the rules: https://sampforum.blast.hk/showthread.php?tid=574725


Re: Death bug. - toxicape - 11.12.2016

This is the code
Quote:

public MoveEMS(playerid)
{
new Float:mX, Float:mY, Float:mZ;
GetPlayerPos(playerid, mX, mY, mZ);

SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicX", mX);
SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicY", mY);
SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicZ", mZ);
SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicVW", GetPlayerVirtualWorld(playerid));
SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicInt", GetPlayerInterior(playerid));

Streamer_UpdateEx(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
SetPlayerPos(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
SetPlayerInterior(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));
SetPlayerVirtualWorld(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));

ClearAnimations(GetPVarInt(playerid, "MovingStretcher"));
ApplyAnimation(GetPVarInt(playerid, "MovingStretcher"), "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);

DeletePVar(GetPVarInt(playerid, "MovingStretcher"), "OnStretcher");
SetPVarInt(playerid, "MovingStretcher", -1);
}

Quote:

public KillEMSQueue(playerid)
{
DeletePVar(playerid, "Injured");
DeletePVar(playerid, "EMSAttempt");
SetPVarInt(playerid, "MedicBill", 1);
DeletePVar(playerid, "MedicCall");

return 1;
}

forward SendEMSQueue(playerid,type);
public SendEMSQueue(playerid,type)
{
switch (type)
{
case 1:
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));

SetPVarInt(playerid, "EMSAttempt", -1);

if(GetPlayerInterior(playerid) > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"), 4000);
GameTextForPlayer(playerid, "~r~Injured~n~~w~ /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);
}
}
return 1;
}




Re: Death bug. - toxicape - 11.12.2016

This is for injured.
Код:
	if(GetPVarInt(playerid, "Injured") == 1)
	{
     	SendClientMessageEx(playerid, COLOR_WHITE, "You appear to be stuck in limbo, medics are trying to revive you.");
	    KillEMSQueue(playerid);
	    ResetPlayerWeaponsEx(playerid);
		if(GetPVarInt(playerid, "activesling") > 0)
		{
			DeletePVar(playerid, "activesling");
		}
	    //SpawnPlayer(playerid);
	    return 1;



Re: Death bug. - BiosMarcel - 11.12.2016

Quote:

This is the code
Quote:
public MoveEMS(playerid)
{
new Float:mX, Float:mY, Float:mZ;
GetPlayerPos(playerid, mX, mY, mZ);

SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicX", mX);
SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicY", mY);
SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicZ", mZ);
SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicVW", GetPlayerVirtualWorld(playerid));
SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicInt", GetPlayerInterior(playerid));

Streamer_UpdateEx(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
SetPlayerPos(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
SetPlayerInterior(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));
SetPlayerVirtualWorld(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));

ClearAnimations(GetPVarInt(playerid, "MovingStretcher"));
ApplyAnimation(GetPVarInt(playerid, "MovingStretcher"), "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);

DeletePVar(GetPVarInt(playerid, "MovingStretcher"), "OnStretcher");
SetPVarInt(playerid, "MovingStretcher", -1);
}
Quote:
public KillEMSQueue(playerid)
{
DeletePVar(playerid, "Injured");
DeletePVar(playerid, "EMSAttempt");
SetPVarInt(playerid, "MedicBill", 1);
DeletePVar(playerid, "MedicCall");

return 1;
}

forward SendEMSQueue(playerid,type);
public SendEMSQueue(playerid,type)
{
switch (type)
{
case 1:
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));

SetPVarInt(playerid, "EMSAttempt", -1);

if(GetPlayerInterior(playerid) > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"), 4000);
GameTextForPlayer(playerid, "~r~Injured~n~~w~ /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);
}
}
return 1;
}

That's not even the code triggering the problem, i guess, i don't even want to read it properly because you didn't format it properly. Good luck in finding help That's nothing personal


Re: Death bug. - toxicape - 11.12.2016

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
That's not even the code triggering the problem, i guess, i don't even want to read it properly because you didn't format it properly. Good luck in finding help That's nothing personal
Okay sir. Gute Nacht.