複製程式
/*******************************************************************************************************
AMX CSS Zoom
Author: KRoTaL
Version: 0.2
0.1 Release
0.2 Fixed the crossair with aug/sg552
Zoom effect of CS-Source.
Cvar:
css_zoom 0/1 - 0: disables the plugin
1: enables the plugin
Setup (AMX 0.9.9):
Install the amx file.
Enable VexdUM (both in metamod/plugins.ini and amx/config/modules.ini)
Setup (AMXX 1.1):
Install the amxx file.
*******************************************************************************************************/
#include <amxmodx>
#include <amxmisc>
new g_msgSetFOV
new g_lastFov[33]
new g_MinFov[33], g_MaxFov[33]
new g_doFov[33]
public plugin_init()
{
register_plugin("CSS Zoom", "0.05", "KRoTaL")
register_cvar("css_zoom", "1") //是否使用CSS型態的狙擊鏡開啟方式 [1=是,0=否]
register_event("SetFOV", "event_SetFOV", "be")
g_msgSetFOV = get_user_msgid("SetFOV")
}
public client_connect(id)
{
g_doFov[id] = false
}
public event_SetFOV(id)
{
new fov = read_data(1)
if (fov < g_lastFov[id])
{
g_MinFov[id] = fov
g_MaxFov[id] = g_lastFov[id]
g_doFov[id] = true
}
else
{
g_doFov[id] = false
}
g_lastFov[id] = fov
}
public client_PreThink(id)
{
if (!get_cvar_num("css_zoom"))
return PLUGIN_CONTINUE;
if (g_doFov[id])
{
if (g_MaxFov[id] > g_MinFov[id])
{
//g_MaxFov[id]--
//set_user_fov(id, g_MaxFov[id]--)
//g_MaxFov[id] = max(g_MaxFov[id] -= 2 , g_MinFov[id])
g_MaxFov[id] = max(g_MaxFov[id] -= 3 , g_MinFov[id])
set_user_fov(id, g_MaxFov[id])
}
else
{
set_user_fov(id, g_MinFov[id])
g_doFov[id] = false
}
}
return PLUGIN_CONTINUE;
}
stock set_user_fov(id, fov)
{
message_begin(MSG_ONE, g_msgSetFOV, {0,0,0}, id)
write_byte(fov)
message_end()
}
請求哪位大大能幫我看看
哪一邊可以改縮放時間