try this one
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#include < amxmisc >
#pragma semicolon 1
#define PLUGIN "Default FOV"
#define VERSION "1.0"
#define AUTHOR "God Of Gaming"
#define CS_DEFAULT_FOV 90
#define cm(%0) ( sizeof(%0) - 1 )
const m_iFOV = 363;
new customFOV[32];
public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR );
for( new i=0; i<32; i++)
customFOV[ i ] = CS_DEFAULT_FOV;
register_clcmd("say", "sayHandle");
register_clcmd("say_team", "sayHandle");
register_message( get_user_msgid( "SetFOV" ), "Message_SetFOV" );
RegisterHam( Ham_Spawn, "player", "OnCBasePlayer_Spawn_P", true );
}
public sayHandle(id)
{
static szArg[192];
read_args(szArg, charsmax(szArg));
remove_quotes(szArg);
if(containi(szArg, "/fov") != -1)
{
replace(szArg, charsmax(szArg), "/fov ", "");
userFOV(id, str_to_num(szArg));
}
}
public userFOV( id, iFOV ) {
if( ( iFOV < 90 ) || ( iFOV > 180 ) )
return PLUGIN_HANDLED;
customFOV[ id ] = iFOV;
message_begin( MSG_ONE, get_user_msgid( "SetFOV" ), {0,0,0}, id );
write_byte( iFOV );
message_end();
return PLUGIN_HANDLED;
}
public Message_SetFOV( msg_id, msg_dest, msg_entity ) {
if( !is_user_alive( msg_entity ) || get_msg_arg_int( 1 ) != CS_DEFAULT_FOV )
return;
set_msg_arg_int( 1, get_msg_argtype( 1 ), customFOV[ msg_entity ] );
}
public OnCBasePlayer_Spawn_P( id ) {
if( is_user_alive( id ) ) {
set_pdata_int( id, m_iFOV, customFOV[ id ] );
}
}