sourcemod吧 关注:454贴子:2,319
  • 5回复贴,共1

关于求生之路sp源码中键代码的问题

只看楼主收藏回复

简单说就是:求生之路sp源码中每个键盘按键对应的英文代码都是啥。。
下面开始我的故事
今天找了一份夜视仪的源码,插件内容是双击F开启夜视仪。但是我想修改F为其它按键,因为求生的时候没事喜欢按F,和CSGO没事就喜欢切枪一样。。。
但是我在sp源码里翻遍了,也没有“F”这种字眼,我以为是键代码这种,我就去搜索“VK_F”、“70”等等,但是也没有。
后来我发现源码中有“IMPULS_FLASHLIGHT”。

我想起来,F键在求生中是开灯。我猜测这个词组代表了F按键。
我又去翻了翻一个需要按E的sp源码。

E键在求生中是互动。所以更加肯定了之前的猜测。
但问题是,我怎么知道求生中每个按键他的代码是啥。。。F对应的是“IMPULS_FLASHLIGHT”,E对应的是“IN_USE”,那么其它按键呢?
请求大神指导,感激不尽。


IP属地:湖北1楼2017-08-01 03:19回复
    IN_ATTACK 攻击1
    IN_JUMP 跳跃
    IN_DUCK 蹲伏
    IN_FORWARD 前进
    IN_BACK 后退
    IN_USE 互动
    IN_CANCEL 取消
    IN_LEFT 左转
    IN_RIGHT 右转
    IN_MOVELEFT 左平移
    IN_MOVERIGHT 右平移
    IN_ATTACK2 攻击2(副攻击键)
    IN_RUN 奔跑(默认shift)
    IN_RELOAD 换弹
    IN_ZOOM 瞄准镜(l4d2中为中键)


    IP属地:江苏2楼2017-08-05 22:20
    收起回复
      2025-05-19 03:18:15
      广告
      摘选自sm api
      Unclassified
      #define IN_ATTACK(1 << 0)
      #define IN_JUMP(1 << 1)
      #define IN_DUCK(1 << 2)
      #define IN_FORWARD(1 << 3)
      #define IN_BACK(1 << 4)
      #define IN_USE(1 << 5)
      #define IN_CANCEL(1 << 6)
      #define IN_LEFT(1 << 7)
      #define IN_RIGHT(1 << 8)
      #define IN_MOVELEFT(1 << 9)
      #define IN_MOVERIGHT(1 << 10)
      #define IN_ATTACK2(1 << 11)
      #define IN_RUN(1 << 12)
      #define IN_RELOAD(1 << 13)
      #define IN_ALT1(1 << 14)
      #define IN_ALT2(1 << 15)
      #define IN_SCORE(1 << 16) /**< Used by client.dll for when scoreboard is held down */
      #define IN_SPEED(1 << 17)/**< Player is holding the speed key */
      #define IN_WALK(1 << 18)/**< Player holding walk key */
      #define IN_ZOOM(1 << 19)/**< Zoom key for HUD zoom */
      #define IN_WEAPON1(1 << 20)/**< weapon defines these bits */
      #define IN_WEAPON2(1 << 21)/**< weapon defines these bits */
      #define IN_BULLRUSH(1 << 22)
      #define IN_GRENADE1(1 << 23)/**< grenade 1 */
      #define IN_GRENADE2(1 << 24)/**< grenade 2 */
      #define IN_ATTACK3(1 << 25)
      #defineFL_ONGROUND(1 << 0)/**< At rest / on the ground */
      #define FL_DUCKING(1 << 1)/**< Player flag -- Player is fully crouched */
      #defineFL_WATERJUMP(1 << 2)/**< player jumping out of water */
      #define FL_ONTRAIN(1 << 3)/**< Player is _controlling_ a train, so movement commands should be ignored on client during prediction. */
      #define FL_INRAIN(1 << 4)/**< Indicates the entity is standing in rain */
      #define FL_FROZEN(1 << 5)/**< Player is frozen for 3rd person camera */
      #define FL_ATCONTROLS(1 << 6)/**< Player can't move, but keeps key inputs for controlling another entity */
      #defineFL_CLIENT(1 << 7)/**< Is a player */
      #define FL_FAKECLIENT(1 << 8)/**< Fake client, simulated server side; don't send network messages to them */
      #define PLAYER_FLAG_BITS9
      #defineFL_INWATER(1 << 9)/**< In water */
      #defineFL_FLY(1 << 10)/**< Changes the SV_Movestep() behavior to not need to be on ground */
      #defineFL_SWIM(1 << 11)/**< Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) */
      #defineFL_CONVEYOR(1 << 12)
      #defineFL_NPC(1 << 13)
      #defineFL_GODMODE(1 << 14)
      #defineFL_NOTARGET(1 << 15)
      #defineFL_AIMTARGET(1 << 16)/**< set if the crosshair needs to aim onto the entity */
      #defineFL_PARTIALGROUND(1 << 17)/**< not all corners are valid */
      #define FL_STATICPROP(1 << 18)/**< Eetsa static prop! */
      #define FL_GRAPHED(1 << 19)/**< worldgraph has this ent listed as something that blocks a connection */
      #define FL_GRENADE(1 << 20)
      #define FL_STEPMOVEMENT(1 << 21)/**< Changes the SV_Movestep() behavior to not do any processing */
      #define FL_DONTTOUCH(1 << 22)/**< Doesn't generate touch functions, generates Untouch() for anything it was touching when this flag was set */
      #define FL_BASEVELOCITY(1 << 23)/**< Base velocity has been applied this frame (used to convert base velocity into momentum) */
      #define FL_WORLDBRUSH(1 << 24)/**< Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) */
      #define FL_OBJECT(1 << 25)/**< Terrible name. This is an object that NPCs should see. Missiles, for example. */
      #define FL_KILLME(1 << 26)/**< This entity is marked for death -- will be freed by game DLL */
      #define FL_ONFIRE(1 << 27)/**< You know... */
      #define FL_DISSOLVING(1 << 28)/**< We're dissolving! */
      #define FL_TRANSRAGDOLL(1 << 29)/**< In the process of turning into a client side ragdoll. */
      #define FL_UNBLOCKABLE_BY_PLAYER(1 << 30)/**< pusher that can't be blocked by the player */
      #define FL_FREEZING(1 << 31)/**< We're becoming frozen! */
      #define FL_EP2V_UNKNOWN1(1 << 31)/**< Unknown */


      IP属地:广西4楼2021-12-03 00:52
      回复