Jump to content

[AMXX-RF] VIP RESPAWN


LondoN eXtream

Recommended Posts

Descriere: Plugin respawn cu avantajele:

 

150 HP la spawn

150 AP la spawn

400 speed cand foloseste cutit.

 

Plugin facut la cerere.

 

Nume: [AMXX] VIP RESPAWN

Versiune: 1.0

Autor: dK^aLeX

 

Instalare:

vip_rs.sma -> scripting

vip_rs.amxx -> plugins

Intram in plugins.ini si adaugam:

vip_rs.amxx

 

Download:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

new cvar_hp, cvar_ap, cvar_speed

new const TAG[] = "[RESPAWN]"
new p_LastSpeed[33]

public plugin_init()
{
    register_plugin("VIP Respawn", "1.0", "dK^aLeX")
    
    cvar_ap = register_cvar("amx_spawn_ap", "150")
    cvar_hp = register_cvar("amx_spawn_hp", "150")
    cvar_speed = register_cvar("amx_knife_speed", "400")
    
    RegisterHam(Ham_Spawn, "player", "fw_hpap", 1)
    
    register_forward(FM_PlayerPreThink, "fw_speed")
    
}

public client_connect(id)
{
    new Flags = get_user_flags(id)
    new Read = read_flags("t")
    
    if(Flags & Read)
    {
        new szName[32]
        get_user_name(id, szName, charsmax(szName))
        
        client_print(0, print_chat, "%s VIP-ul %s se conecteaza pe server!", TAG, szName)
    }
}

public fw_hpap(iPlayer)
{
    new Flags = get_user_flags(iPlayer)
    new Read = read_flags("t")
    
    if(Flags & Read)
    {        
        set_user_armor(iPlayer, get_pcvar_num(cvar_ap))
        
        set_user_health(iPlayer, get_pcvar_num(cvar_hp))
        
        client_print(iPlayer, print_chat, "%s Ai primit %s HP & %s AP.", TAG, get_pcvar_num(cvar_hp), get_pcvar_num(cvar_ap))
    }
}

public fw_speed(id)
{
    new Flags = get_user_flags(id)
    new Read = read_flags("t")
    
    if(Flags & Read)
    {
        new szTemp, szWeapon = get_user_weapon(id, szTemp, szTemp)
        if(szWeapon == CSW_KNIFE)
        {
            pev(id, pev_maxspeed, p_LastSpeed[id])
            set_pev(id, pev_maxspeed,  get_pcvar_float(cvar_speed))
        }
        else
        {
            return PLUGIN_HANDLED;
        }
    }
    
    return PLUGIN_CONTINUE;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...