Help EMS
#1

Help me...Whenever i die i go directly into the hospital...i want the /service ems

PHP код:
public OnPlayerDeath(playeridkilleridreason

    
PlayerInfo[playerid][pOverdose] = 0
    new 
string[128]; 
    
// Anti-Fake Kill by Neonman 
    
if(PlayerInfo[playerid][pAdmin] < 2
    { 
        new 
time gettime(); 
        switch(
time LastDeath[playerid]) 
        { 
            case 
0..3
            { 
                
DeathSpam[playerid]++; 
                if(
DeathSpam[playerid] == 3// The maximum spam of deaths after the cheater will get banned. 
                

                    new 
IP[128]; 
                    
GetPlayerIp(playeridIPsizeof(IP)); 
                    
format(stringsizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has been automatically kicked for death spamming."GetPlayerNameEx(playerid), playerid); 
                    
ABroadCast(COLOR_YELLOWstring2); 
                    
format(stringsizeof(string), "[Death Spam] %s has been kicked for death spam. (IP: %s)",GetPlayerNameEx(playerid), playeridIP); 
                    
Log("logs/fakedeath.log"string); 
                       
ShowPlayerDialog(playeridDIALOG_SHOW_INFODIALOG_STYLE_MSGBOX"{FFFFFF}Kicked from server""You have been kicked from the server for fake kill.""Ok""Cancel"); 
                    
SetTimerEx("SendToKick"3000"i"playerid); 
                } 
                return 
1
            } 
            default: 
DeathSpam[playerid] = 0
        } 
        
LastDeath[playerid] = time
    } 
    if(
IsPlayerConnected(killerid)) 
    { 
        new 
hour,minute,secondweaponname[32]; 
        
gettime(hour,minute,second); 
        
FixHour(hour); 
        
hour shifthour
        
GetWeaponName(reasonweaponnamesizeof(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") == 0PlayerInfo[killerid][pDMKills]++; 
    } 
    
pTazer[playerid] = 0
    
InsideShamal[playerid] = INVALID_VEHICLE_ID
    
DeletePVar(playerid"SpeedRadar"); 
    
DeletePVar(playerid"UsingSprunk"); 
    if(
arr_Wrecking[playerid] != INVALID_VEHICLE_ID
    { 
        
//UnwreckVehicle(arr_Wrecking[playerid], 1); 
        
arr_Wrecking[playerid] = INVALID_VEHICLE_ID
    } 
    
DestroyDynamicObject(GetPVarInt(playerid"neon")); 
    
DestroyDynamicObject(GetPVarInt(playerid"neon1")); 
    
DeletePVar(playerid"neon0"); 
    
DeletePVar(playerid"neon1"); 
    
KillTimer(GetPVarInt(playerid"firstaid5")); 
      
DeletePVar(playerid"usingfirstaid"); 
    
DeletePVar(playerid"usingbandage"); 
    if(
GetPVarInt(playerid"MovingStretcher") != -1
    { 
        
KillTimer(GetPVarInt(playerid"TickEMSMove")); 
        
DeletePVar(GetPVarInt(playerid"MovingStretcher"), "OnStretcher"); 
        
SetPVarInt(playerid"MovingStretcher", -1); 
    } 
    if(
GetPVarInt(playerid"runningRadar") >= 1
    { 
        new 
vehid gLastCar[playerid]; 
        if(
CheckingSpeed[vehid] > 0
        { 
            
KillTimer(CheckingSpeed[vehid]); 
            
CheckingSpeed[vehid] = 0
        } 
        
PlayerTextDrawDestroy(playeridRadarHud); 
        
PlayerTextDrawDestroy(playeridSpeedAndModel); 
        
DeletePVar(playerid"runningRadar"); 
        
Radars -= 1
    } 
    new 
caller Mobile[playerid]; 
    if(
IsPlayerConnected(Mobile[playerid])) 
    { 
        
SendClientMessageEx(caller,  COLOR_GRAD2"The line went dead."); 
        
format(stringsizeof(string), "* %s puts away their cellphone."GetPlayerNameEx(caller)); 
        
ProxDetector(30.0callerstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
        
CellTime[caller] = 0
        
KillTimer(VmailTmer[caller]); 
        
KillTimer(VmailTmer[playerid]); 
        
Mobile[caller] = INVALID_PLAYER_ID
    } 
    
Mobile[playerid] = INVALID_PLAYER_ID
    
CellTime[playerid] = 0
    
KillTimer(VmailTmer[playerid]); 
    
KillTimer(VmailTmer[caller]); 
    
RingTone[playerid] = 0
    foreach(
Playeri
    { 
        if(
EMSAccepted[i] < 999
        { 
             if(
EMSAccepted[i] == playerid
               { 
                 
EMSAccepted[i] = 999
                   
GameTextForPlayer(i"~w~EMS Caller~n~~r~Has Died"50001); 
                
EMSCallTime[i] = 0
                
DisablePlayerCheckpoint(i); 
            } 
        } 
    } 
    if( 
GetPVarInt(playerid"SpecOff" ) == 
    { 
        
SpawnPlayer(playerid); 
        return 
1
    } 
    if(
GetPVarInt(playerid"Injured") == 1
    { 
         
SendClientMessageEx(playeridCOLOR_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"); 
        } 
Reply
#2

Anyone help Me
Reply
#3

I am sorry I cannot help you, and I shouldn't post, but seriously, I had to say that, THAT CODE SUCKS!

No arrays, PVars and repetitive code?

Peace out, sorry for posting
Reply
#4

But can you remake it?
Reply
#5

Help me
Reply
#6

KilotD, try to use this script and take the codes of the command and replace your own code.
http://forum.sa-mp.com/showthread.ph...hlight=horizon
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)