|
发表于 2005-11-14 11:50:54
|
显示全部楼层
|阅读模式
来自 中国–北京–北京–通州区
很多人在编辑的时候,都很难在单机上看到自己插件的效果~因为无法看到自己的样子,这个插件实现的功能就是转换玩家视角到第三人称,达到看到自己的目的!~这样就可以在测试插件的时候看到插件对自己的效果。
[ATTID]8990[/ATTID]
[PHP]
/*
Change View Type created by OneEyed.
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
/*--------------------------------------------------------//
Change this to different if you want only admins to use.
e.g. #define ACCESS_TYPE ADMIN_KICK
or
#define ACCESS_TYPE ADMIN_RCON
//--------------------------------------------------------*/
#define ACCESS_TYPE 0
//--------------------------------------------------------//
new view[32]
//Precache of rpgrocket.mdl is NEEDED, for some odd reason.
public plugin_precache()
precache_model("models/rpgrocket.mdl")
public plugin_init() {
register_plugin("Change View","v1.0","OneEyed")
register_concmd("amx_view","changeView",ACCESS_TYPE,"Cycles through 4 different view types.")
}
public client_disconnect(id)
view[id] = 1
public client_connect(id)
view[id] = 1
public changeView(id,level,cid) {
if ( !cmd_access(id,level,cid,0) )
return PLUGIN_HANDLED
new viewtype[32]
if(view[id] > 3)
view[id] = 0
switch(view[id])
{
case 0: format(viewtype,31,"正规")
case 1: format(viewtype,31,"第三人称")
case 2: format(viewtype,31,"第三人称 (右上角)")
case 3: format(viewtype,31,"第三人称 (顶部)")
}
client_print(id,print_chat,"改变玩家视角为: %s",viewtype)
set_view(id, view[id])
view[id]++
return PLUGIN_HANDLED
}
[/PHP] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|