Primo
типа серьёзный тип
- Сообщения
- 1,532
- Реакции
- 759
@Pautinka553, это сделать можно. Ставим sm_cvar mp_flashlight 1. Ловим нажатие той или иной клавиши через OnPlayerRunCmd, и делаем FakeClientCommand(client, "impulse 100");
Значит плагин бесполезен.Это сделать НЕЛЬЗЯ!
Можно сделать. Только действие назначается не на какую-то кнопку, а на действие:Мне надо что бы фонарик был на одной кнопке а осмотр оружия на другой кто нибудь сможет сделать так?
// These defines are for client button presses.
#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)
Ты запрещаешь? :crazy:Это сделать НЕЛЬЗЯ!
Ну попробуй сделать на действие,только потом кинь мне исходник.Можно сделать. Только действие назначается не на какую-то кнопку, а на действие:Ты запрещаешь? :crazy:PHP:// These defines are for client button presses. #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)
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
{
if(buttons & IN_USE)
{
FakeClientCommand(client, "impulse 100");
}
}
тебе на какое из списка 26 действий?Ну попробуй сделать на действие
public Action:OnPlayerRunCmd(iClient, &iButtons, &iImpulse, Float:vecVelocity[3], Float:vecAngles[3], &iWeapon, &iWeaponSub, &nCommand, &nTick, &iRandomSeed, iMouseDir[2])
{
if (bEnabled && 0 < iClient <= MaxClients && IsClientInGame(iClient) && IsPlayerAlive(iClient))
{
if(iButtons & IN_SCORE) ToggleFlashlight(client);
}
return Plugin_Continue;
}