|
发表于 2011-8-17 17:36:19
|
显示全部楼层
来自 中国–广东–深圳
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- //#include <hamsandwich>
- public plugin_init()
- {
- register_plugin("Give AWP", "1.0", "Jakyo")
- // RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
- register_event("ResetHUD", "player_spawn", "be")
- }
- public player_spawn(id)
- {
- if ( !is_user_connected(id) || !is_user_alive(id))
- return PLUGIN_CONTINUE
- fm_give_item(id, CSW_AWP)
- fm_give_item(id, CSW_AWP)
- fm_give_item(id, CSW_AWP)
- return PLUGIN_CONTINUE
- }
- //public fw_PlayerSpawn_Post(id)
- //{
- // if ( !is_user_connected(id))
- // return HAM_IGNORED
- //
- // fm_give_item(id, CSW_AWP)
- //
- // return HAM_IGNORED
- //}
- // 给予玩家武器
- stock fm_give_item(id, weaponid)
- {
- if (!is_user_alive(id)) return
- new item[32]
- get_weaponname(weaponid, item, sizeof item - 1)
-
- new ent
- ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
- if (!pev_valid(ent)) return;
-
- new Float:originF[3]
- pev(id, pev_origin, originF)
- set_pev(ent, pev_origin, originF)
- set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
- dllfunc(DLLFunc_Spawn, ent)
-
- new save
- save = pev(ent, pev_solid)
- dllfunc(DLLFunc_Touch, ent, id)
- if (pev(ent, pev_solid) != save)
- return;
-
- engfunc(EngFunc_RemoveEntity, ent)
- }
复制代码 |
|