User-Profile-Image
hankin
  • 5
  • 关于
  • 分类
    • 路由器
    • 电脑相关
    • 游戏相关
    • 未分类
    • 服务器相关
    • 数据库
  • 页面
    • 关于
  • 友链
    • 华夏网盟
Help?

Please contact us on our email for need any support

Support
  • 关于
    首页   ›   游戏相关   ›   正文
游戏相关

求生之路 第三人称模式-源码

2021-02-23 08:54:40
119  0 0
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "2.12"
#define CVAR_FLAGS          FCVAR_PLUGIN|FCVAR_NOTIFY

#define DEBUG 0

new Handle:timer_handle=INVALID_HANDLE;


public Plugin:myinfo =
{
 name = "thirdperson view",
 author = "Pan Xiaohai",
 version = PLUGIN_VERSION,
 url = "http://forums.alliedmods.net"
}


public OnPluginStart()
{

 HookEvent("player_spawn", Event_Spawn);
  RegConsoleCmd("sm_3",third, "into thirdperson");
 RegConsoleCmd("sm_1", first, "into firstperson");

}

public PlayerConnectFull(Handle:event, const String:name[], bool:dontBroadcast)
{
 new client = GetClientOfUserId(GetEventInt(event, "userid"));
 ClientCommand(client, "bind [ \"say /1\"");
 ClientCommand(client, "bind ] \"say /3\"");
}
public OnClientDisconnect(client)
{
 ClientCommand(client, "bind [ \"\"");
 ClientCommand(client, "bind ] \"\"");
}
public Event_Spawn(Handle:Spawn_Event, const String:Spawn_Name[], bool:Spawn_Broadcast)
{
 new client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
  ClientCommand(client, "bind [ \"say /1\"");
 ClientCommand(client, "bind ] \"say /3\"");
}
public OnMapStart()
{
 timer_handle=CreateTimer(280.0, Msg, 0, TIMER_REPEAT);
}
public OnMapEnd()
{
 KillTimer(msg_handle);
}


public Action:Msg(Handle:timer, any:data)
{
 PrintToChatAll("\x03Press \x04[ \x03and \x04]\x03 change view between firstperson and thirdperson");
   return Plugin_Continue;
}
public Action:third(client, args)
{

 ClientCommand(client, "thirdpersonshoulder");
 ClientCommand(client, "c_thirdpersonshoulderoffset 0");
 ClientCommand(client, "c_thirdpersonshoulderaimdist 720");
 ClientCommand(client, "cam_ideallag 0");
 if(GetClientTeam(client)==3) ClientCommand(client, "cam_idealdist 90");
 else ClientCommand(client, "cam_idealdist 40");

 ClientCommand(client, "bind leftarrow \"incrementvar cam_idealdist 30 130 10\"");
 ClientCommand(client, "bind rightarrow \"incrementvar cam_idealdist 30 130 -10\"");

 ClientCommand(client, "bind uparrow \"incrementvar c_thirdpersonshoulderheight 5 25 5\"");
 ClientCommand(client, "bind downarrow \"incrementvar c_thirdpersonshoulderheight 5 25 -5\"");

  decl String:player_name[65];
 GetClientName(client, player_name, sizeof(player_name));

  PrintToChat(client, "\x03Press\x04 arrow keys \x03to adjust view");
 return Plugin_Handled;
}
public Action:first(client, args)
{

 ClientCommand(client, "thirdpersonshoulder");
 ClientCommand(client, "c_thirdpersonshoulder 0");
 return Plugin_Handled;
}

 
评论 (0)

Click here to cancel reply.

欢迎您 游客  

近期文章

  • 用于网速测试的下载测速文件合集
  • docker构建SB镜像
  • pterodactl docker install
  • OpenWRT流量实时监控插件
  • docker部署dify

近期评论

No comments to show.

归档

  • 1 月 2026
  • 8 月 2025
  • 5 月 2025
  • 4 月 2025
  • 3 月 2025
  • 2 月 2025
  • 12 月 2024
  • 4 月 2024
  • 10 月 2023
  • 8 月 2023
  • 4 月 2023
  • 3 月 2023
  • 2 月 2023
  • 10 月 2021
  • 5 月 2021
  • 3 月 2021
  • 2 月 2021

分类

  • 数据库
  • 服务器相关
  • 未分类
  • 游戏相关
  • 电脑相关
  • 路由器
Copyright © 2026
smarty_hankin 主题. Designed by hankin
主页
页面
  • 关于
博主
hkthomas 管理员
136 文章 0 评论 18291 浏览
测试
测试