hlmod.hu
https://hlmod.hu/

HL2 Doboz
https://hlmod.hu/viewtopic.php?f=10&t=3911
Oldal: 1 / 1

Szerző:  kacsa [2012.04.01. 15:51 ]
Hozzászólás témája:  HL2 Doboz

Sziasztok.
Mint tudjátok van ez a HL2 Doboz plugin
http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=hl2box
Valaki megtudná-e csinálni hogy a parancsot csak adminok hassználhassák??

Szerző:  VirTuaL ~` [2012.04.01. 16:23 ]
Hozzászólás témája:  Re: HL2 Doboz

Kód:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
#define BOXMODEL "models/hl2box.mdl"
#define BOXSOUND "debris/bustcrate1.wav"
#define BOXBLOCK "fvox/bell.wav"
#define PLUGIN "HL2 boxes"
#define VERSION "1.0"
#define AUTHOR "MaHu"
new cvar_cost
public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_clcmd("say /box","box");
   register_clcmd("say_team /box","box");
   register_clcmd("say /doboz","box");
   register_clcmd("say_team /doboz","box");
   cvar_cost = register_cvar("box_cost","5000");
   RegisterHam(Ham_TakeDamage, "func_breakable", "fwdBreakableTakeDamage", 1)
}


public plugin_precache(){
   precache_model(BOXMODEL)
   precache_model("models/woodgibs.mdl")
   precache_sound("debris/bustcrate1.wav")
   precache_sound("debris/bustcrate2.wav")
   precache_sound("debris/bustcrate3.wav")
   precache_sound("debris/bustglass2.wav")
   precache_sound(BOXSOUND)
   precache_sound(BOXBLOCK)
}


public box(id,ent)
{
if (get_user_flags(id) & ADMIN_KICK) {
    if(cs_get_user_money(id) < get_pcvar_num(cvar_cost)){
    client_print(id,print_chat,"you need $%d to use box",get_pcvar_num(cvar_cost))
    emit_sound(id, CHAN_ITEM, BOXBLOCK, 1.0, ATTN_NORM, 0, PITCH_NORM)
    return
    }

    new bablo = cs_get_user_money(id)
    new Float:fVelocity[3], Float:fOrigin[3]
    new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_breakable"))
    fm_set_kvd(ent, "material", "1", "func_breakable")
    dllfunc(DLLFunc_Spawn, ent)
    emit_sound(id, CHAN_ITEM, BOXSOUND, 1.0, ATTN_NORM, 0, PITCH_NORM)
    cs_set_user_money(id,bablo - get_pcvar_num(cvar_cost))
    entity_get_vector(id, EV_VEC_origin, fOrigin)
    VelocityByAim(id, 34, fVelocity)
   
    fOrigin[0] += fVelocity[0]
    fOrigin[1] += fVelocity[1]

    VelocityByAim(id, 300, fVelocity)
    entity_set_string(ent, EV_SZ_classname, "hl2box")
    entity_set_model(ent, BOXMODEL)
    entity_set_size(ent, Float:{ -10.0, -10.0, 0.0 }, Float:{ 10.0, 10.0, 25.0 })
    entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS)
    entity_set_vector(ent, EV_VEC_origin, fOrigin)
    entity_set_float(ent, EV_FL_health, 200.0)
    entity_set_float(ent, EV_FL_takedamage, DAMAGE_AIM)
    entity_set_int(ent, EV_INT_solid, SOLID_BBOX)
    entity_set_int(ent, EV_INT_sequence, 0)
    entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.01)
    drop_to_floor(ent)
}

else
{
 client_print(id, print_chat, "[Szerver] Csak adminok hasznalhatjak!");
}
}

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/