Problem with /service ems please read
#1

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:mXFloat:mYFloat:mZ;
    
GetPlayerPos(playeridmXmYmZ);
    
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"), mXmYmZ);
    
SetPlayerPos(GetPVarInt(playerid"MovingStretcher"), mXmYmZ);
    
SetPlayerInterior(GetPVarInt(playerid"MovingStretcher"), GetPlayerVirtualWorld(playerid));
    
SetPlayerVirtualWorld(GetPVarInt(playerid"MovingStretcher"), GetPlayerVirtualWorld(playerid));
    
ClearAnimations(GetPVarInt(playerid"MovingStretcher"));
    
ApplyAnimation(GetPVarInt(playerid"MovingStretcher"), "SWAT""gnstwall_injurd"4.0011101);
    
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(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            
SetPlayerPos(playeridGetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
            
SetPlayerVirtualWorld(playeridGetPVarInt(playerid,"MedicVW"));
              
SetPlayerInterior(playeridGetPVarInt(playerid,"MedicInt"));
            
SetPVarInt(playerid"EMSAttempt", -1);
            if(
GetPlayerInterior(playerid) > 0)
            {
                
TogglePlayerControllable(playerid0);
                
SetPVarInt(playerid"LoadingObjects"1);
                
SetTimerEx("SafeLoadObjects"40000"d"playerid);
            }
            
GameTextForPlayer(playerid"~r~Injured~n~~w~/service ems"50003);
            
ClearAnimations(playerid);
            
ApplyAnimation(playerid"KNIFE""KILL_Knife_Ped_Die"4.0011101);
            
SetPlayerHealth(playerid100);
            
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.0011101);
            
SetPlayerHealth(playerid100);
            
SetPlayerArmour(playerid,0);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)