Knife WarmUp Help

Сообщения
48
Реакции
4
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Hello who can help me to edit this plugin , i want warmup knife to have 70 second and show in HUD , WARMUP %s second!, and in my old plugin have sound to remove sound and to add and respawn when finishin warmup , and all players to have 50HP ?
 

Вложения

Сообщения
27
Реакции
-7
Код:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
      
new Timer, SecondsCvar, HudSyncMsg
new bool:g_knife = true
    
#define MAP50HP
    
public plugin_init()
{
    register_plugin( "WarmUP" , "1.0", "ExTrEaM" )
            
    register_event("DeathMsg", "on_death", "a")
    register_event( "CurWeapon", "EventCurWeapon", "be", "2!29" )
            
    SecondsCvar = register_cvar("auto_rr_time","70.0")
      
    Timer = get_pcvar_num(SecondsCvar)
    set_task(1.0, "start_rr_timer", _, _, _, "a", Timer)
    HudSyncMsg = CreateHudSyncObj()
    
   RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Player", 1)
    
}
 
public Ham_Spawn_Player(id)
{
   if(g_knife)
      set_pev( id, pev_health, 50.0 )
}
      
public on_death()
{
        new victim
        victim = read_data(2)
            
        if(g_knife)
                set_task(1.0, "fnRevivePlayer", victim)
}
      
public fnRevivePlayer(id)
{
       if(!is_user_alive(id))
       ExecuteHamB(Ham_CS_RoundRespawn, id)
      #if defined MAP50HP
      set_pev( id, pev_health, 50.0 )
      #endif
}
      
public EventCurWeapon(id)
{
        if(g_knife)
                engclient_cmd(id, "weapon_knife")
}
      
public start_rr_timer()
{
    Timer--
    set_hudmessage(0, 255, 0, -1.0, 0.08, 0, _, 1.0, _, _, -1)
    ShowSyncHudMsg(0, HudSyncMsg, "NXEMJE !^nRestart per %d sekonda", Timer)
      
    if(Timer < 1)
    {
                server_cmd("sv_restartround 1")
                set_task(3.0, "rr_end")
                g_knife = false
    }
}
      
public rr_end()
{
    set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 0, 1.0, 5.0, 0.1, 2.0, -1)
    show_hudmessage(0, "Suksese ne loje!")
}
 
Сообщения
48
Реакции
4
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Код:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
     
new Timer, SecondsCvar, HudSyncMsg
new bool:g_knife = true
   
#define MAP50HP
   
public plugin_init()
{
    register_plugin( "WarmUP" , "1.0", "ExTrEaM" )
           
    register_event("DeathMsg", "on_death", "a")
    register_event( "CurWeapon", "EventCurWeapon", "be", "2!29" )
           
    SecondsCvar = register_cvar("auto_rr_time","70.0")
     
    Timer = get_pcvar_num(SecondsCvar)
    set_task(1.0, "start_rr_timer", _, _, _, "a", Timer)
    HudSyncMsg = CreateHudSyncObj()
   
   RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Player", 1)
   
}

public Ham_Spawn_Player(id)
{
   if(g_knife)
      set_pev( id, pev_health, 50.0 )
}
     
public on_death()
{
        new victim
        victim = read_data(2)
           
        if(g_knife)
                set_task(1.0, "fnRevivePlayer", victim)
}
     
public fnRevivePlayer(id)
{
       if(!is_user_alive(id))
       ExecuteHamB(Ham_CS_RoundRespawn, id)
      #if defined MAP50HP
      set_pev( id, pev_health, 50.0 )
      #endif
}
     
public EventCurWeapon(id)
{
        if(g_knife)
                engclient_cmd(id, "weapon_knife")
}
     
public start_rr_timer()
{
    Timer--
    set_hudmessage(0, 255, 0, -1.0, 0.08, 0, _, 1.0, _, _, -1)
    ShowSyncHudMsg(0, HudSyncMsg, "NXEMJE !^nRestart per %d sekonda", Timer)
     
    if(Timer < 1)
    {
                server_cmd("sv_restartround 1")
                set_task(3.0, "rr_end")
                g_knife = false
    }
}
     
public rr_end()
{
    set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 0, 1.0, 5.0, 0.1, 2.0, -1)
    show_hudmessage(0, "Suksese ne loje!")
}
Thanks very much :D
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу