10.11.2014, 15:58
Well when someone dies in my server it sends them straight to hospital even if FD is on duty here is the code
PHP код:
// MoveEMS Function(playerid)
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);
}
// KillEMSQueue Function(playerid)
public KillEMSQueue(playerid)
{
DeletePVar(playerid, "Injured");
DeletePVar(playerid, "EMSAttempt");
SetPVarInt(playerid, "MedicBill", 1);
DeletePVar(playerid, "MedicCall");
return 1;
}
// SendEMSQueue Function(playerid)
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)
{
TogglePlayerControllable(playerid, 0);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
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;
}