请教这个T/CT帽子插件怎么样改才正确呢?
#include <amxmodx>#include <fakemeta>
#include <hamsandwich>
new g_bwEnt
public plugin_init(){
register_plugin("HATS", "0.2", "HATS")
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
register_event("DeathMsg","Death_Remove_Hat","a");
}
public plugin_precache(){
precache_model("models/Hat/dodgerscap.mdl")
precache_model("models/Hat/santahat.mdl")
}
public client_connect(id){
if(g_bwEnt > 0) engfunc(EngFunc_RemoveEntity,g_bwEnt)
g_bwEnt = 0
}
public client_disconnect(id){
if(g_bwEnt > 0) engfunc(EngFunc_RemoveEntity,g_bwEnt)
g_bwEnt = 0
}
public Spawn(id){
if( is_user_alive(id) ){
if( get_user_team(id)==1 ){
set_pev(g_bwEnt, pev_movetype, MOVETYPE_FOLLOW)
set_pev(g_bwEnt, pev_aiment, id)
set_pev(g_bwEnt, pev_rendermode, kRenderNormal)
set_pev(g_bwEnt, pev_renderamt, 0.0)
engfunc(EngFunc_SetModel, g_bwEnt, dodgerscap.mdl)
}
else if( get_user_team(id)==2 ){
set_pev(g_bwEnt, pev_movetype, MOVETYPE_FOLLOW)
set_pev(g_bwEnt, pev_aiment, id)
set_pev(g_bwEnt, pev_rendermode, kRenderNormal)
set_pev(g_bwEnt, pev_renderamt, 0.0)
engfunc(EngFunc_SetModel, g_bwEnt, santahat.mdl)
}
}
return PLUGIN_CONTINUE
}
public Death_Remove_Hat(){
new victim = read_data(2)
if(is_user_connected(victim)){
engfunc(EngFunc_RemoveEntity,g_bwEnt)
g_bwEnt = 0
}
return PLUGIN_CONTINUE
} 学习一下了 http://forums.alliedmods.net/showthread.php?t=69386 本帖最后由 心静如水 于 2009-4-15 21:28 编辑
谢谢W版主....不过太深奥了........原以为用两个事件就能解决了..........
主要是想知道戴帽子的命令.................... http://forums.alliedmods.net/showthread.php?t=67801 额。插件应该有地方改的吧
页:
[1]