|
楼主 |
发表于 2011-8-27 23:31:18
|
显示全部楼层
来自 中国–湖北–武汉
本帖最后由 Osker Lee 于 2011-8-31 22:28 编辑
已解决,在游戏中输入/cam即可打开第三人称视觉的菜单。
#include <amxmodx>
#include <engine>
#include <fakemeta>
#define PLUGIN "Player Camera"
#define VERSION "1.0"
#define AUTHOR "Osker Lee"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menucmd(register_menuid("Choose Camera View"), 1023, "setview")
register_forward(FM_AddToFullPack, "AddToFullPack")
register_clcmd("say /camera", "chooseview")
register_clcmd("say_team /camera", "chooseview")
register_clcmd("say /cam", "chooseview")
register_clcmd("say_team /cam", "chooseview")
}
public plugin_modules()
{
require_module("engine")
}
public plugin_precache()
{
precache_model("models/rpgrocket.mdl")
}
public chooseview(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4
format(menu, 191, "Choose Camera View^n^n1. Upleft View^n2. 3RD View^n3. Upside View^n4. Normall View^n^n0. Exit")
show_menu(id, keys, menu)
return PLUGIN_CONTINUE
}
public setview(id, key, menu)
{
if(key == 0) {
set_view(id, CAMERA_UPLEFT)
return PLUGIN_HANDLED
}
if(key == 1) {
set_view(id, CAMERA_3RDPERSON)
return PLUGIN_HANDLED
}
if(key == 2) {
set_view(id, CAMERA_TOPDOWN)
return PLUGIN_HANDLED
}
if(key == 3) {
set_view(id, CAMERA_NONE)
return PLUGIN_HANDLED
}
else {
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public AddToFullPack(es, e, ent, host, hostflags, player, pSet)
{
if( player )
{
if(ent == host)
{
set_pev(ent, pev_rendermode, kRenderNormal)
set_pev(ent, pev_renderamt, 0)
}
}
return FMRES_IGNORED
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|