Hello, I'm new in SourcePawn scripting and I request help to make a script :
I want to set a new FOV for the players.
I tried to use
CBasePlayer::SetFOV from the
http://forums.alliedmods.net/showthread.php?t=55565
This is my scripts who don't work
PHP Code:
public Plugin:myinfo =
{
name = "FOV Changer",
author = "HRG Team - Tournevis_man and Pinguinman",
description = "Set the FOV to a player",
version = "1.0.0",
url = "http://www.sourcemod.net/"
};
#include <sourcemod>
#include <sdktools>
#undef REQUIRE_PLUGIN
#include <adminmenu>
#include <sigoffset>
new Handle:g_cvar = INVALID_HANDLE;
public OnPluginStart()
{
g_cvar = FindConVar ("fov_desired")
RegAdminCmd("sm_fov", SetFOV, ADMFLAG_CUSTOM1, "sm_fov <FOV> Sets the FOV of given value. Default: 90");
}
public CBasePlayer::SetFOV(clients, args)
{
if (args < 1)
{ ReplyToCommand(client, "[SM] Usage: sm_fov <fov>");
return Plugin_Handled;
}
decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));
SetConVarInt(g_cvar, StringToInt(arg));
PrintToChatAll("[SM] FOV set to: %s", arg);
LogMessage("Chat: %L FOV set to: %s", client, arg);
return Plugin_Handled;
}
Thanks for help