关于第三人称视角插件的问题
我在网上找到了一个第三人称视角插件(player_camera.amxx),在控制台输入camera_menu即可选择第三人称的视觉类型。插件用在僵尸模式里不会出现模型重叠的问题,而且模型还是不透明的。不过插件的作者没有开源,只放了个成品出来,插件在附件里。我在AlliedModder论坛找到了一个类似的插件(Camera Changer),输入/camera即可选择第三人称的视觉类型。但我发现第三人称的模型是透明的,我想改成不透明的,但增加以下代码也无法解决问题,不知道有什么办法能弄成不透明的吗?
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
下面是Camera Changer的源代码:
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
register_plugin("Camera Changer", "1.0", "XunTric")
register_menucmd(register_menuid("Choose Camera View"), 1023, "setview")
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
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
format(menu, 191, "Choose Camera View^n^n1. 3rd Person View^n2. Upside View^n3. 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_3RDPERSON)
return PLUGIN_HANDLED
}
if(key == 1) {
set_view(id, CAMERA_TOPDOWN)
return PLUGIN_HANDLED
}
if(key == 2) {
set_view(id, CAMERA_NONE)
return PLUGIN_HANDLED
}
else {
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
本帖最后由 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
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
}
我喜欢直接发源码上来的 拿走试试 谢谢了 太牛逼了这个 楼主你太好了.........
. 顶一个需要 太牛逼了,正需要这样的插件
页:
[1]