Переключатель оружия

MarioK

Новичок
Автор темы
4
1
Версия SA-MP
  1. 0.3.7 (R1)
Hello.

I need an example that if I press the "1" button on my keyboard, my character will switch to fists. Thanks in advance.


Like this:

Код:
: WEP_SWITCH_361
041A: 1 @ = actor $ PLAYER_ACTOR weapon 29 ammo 
if and
key_down 52 
  1 @> 0 
else_jump @ WEP_SWITCH_400 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 29
 

MarioK

Новичок
Автор темы
4
1
Thanks, but the only thing I need is missing, a key to switch to fists.

Код:
{$ CLEO .cs}

// ------------- MAIN ---------------
thread 'wep_switch' 
wait 5000 
if 
0AE6: 4 @ = find_first_file "SAMPFUNCS * .asi" get_filename_to 5 @ v // IF and SET 
else_jump @ WEP_SWITCH_73 
jump @ WEP_SWITCH_80 
jump @ WEP_SWITCH_80 

: WEP_SWITCH_73
jump @ WEP_SWITCH_151 

: WEP_SWITCH_80
wait 0 
if or
   SAMP.ChatInputOpened
   SAMP.IsDialogActive (0 @)
else_jump @ WEP_SWITCH_109 
jump @ WEP_SWITCH_80 

: WEP_SWITCH_109
gosub @ WEP_SWITCH_197 
gosub @ WEP_SWITCH_238 
gosub @ WEP_SWITCH_279 
gosub @ WEP_SWITCH_320 
gosub @ WEP_SWITCH_361 
jump @ WEP_SWITCH_80 

: WEP_SWITCH_151
wait 0 
gosub @ WEP_SWITCH_197 
gosub @ WEP_SWITCH_238 
gosub @ WEP_SWITCH_279 
gosub @ WEP_SWITCH_320 
gosub @ WEP_SWITCH_361 
jump @ WEP_SWITCH_151 

: WEP_SWITCH_197
041A: 1 @ = actor $ PLAYER_ACTOR weapon 31 ammo 
if and
key_down 53 
  1 @> 0 
else_jump @ WEP_SWITCH_236 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 31 

: WEP_SWITCH_236
return 

: WEP_SWITCH_238
041A: 1 @ = actor $ PLAYER_ACTOR weapon 30 ammo 
if and
key_down 53 
  1 @> 0 
else_jump @ WEP_SWITCH_277 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 30 

: WEP_SWITCH_277
return 

: WEP_SWITCH_279
041A: 1 @ = actor $ PLAYER_ACTOR weapon 24 ammo 
if and
key_down 50 
  1 @> 0 
else_jump @ WEP_SWITCH_318 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 24 

: WEP_SWITCH_318
return 

: WEP_SWITCH_320
041A: 1 @ = actor $ PLAYER_ACTOR weapon 25 ammo 
if and
key_down 51 
  1 @> 0 
else_jump @ WEP_SWITCH_359 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 25 

: WEP_SWITCH_359
return 

: WEP_SWITCH_361
041A: 1 @ = actor $ PLAYER_ACTOR weapon 29 ammo 
if and
key_down 52 
  1 @> 0 
else_jump @ WEP_SWITCH_400 
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 29 

: WEP_SWITCH_400
return



How can I implement
Код:
01B9: set_actor $ PLAYER_ACTOR weapon_weapon_to 0
in my code?
 

БеzликиЙ

Автор темы
Проверенный
984
571
Thanks, but the only thing I need is missing, a key to switch to fists.

Код:
{$ CLEO .cs}

// ------------- MAIN ---------------
thread 'wep_switch'
wait 5000
if
0AE6: 4 @ = find_first_file "SAMPFUNCS * .asi" get_filename_to 5 @ v // IF and SET
else_jump @ WEP_SWITCH_73
jump @ WEP_SWITCH_80
jump @ WEP_SWITCH_80

: WEP_SWITCH_73
jump @ WEP_SWITCH_151

: WEP_SWITCH_80
wait 0
if or
   SAMP.ChatInputOpened
   SAMP.IsDialogActive (0 @)
else_jump @ WEP_SWITCH_109
jump @ WEP_SWITCH_80

: WEP_SWITCH_109
gosub @ WEP_SWITCH_197
gosub @ WEP_SWITCH_238
gosub @ WEP_SWITCH_279
gosub @ WEP_SWITCH_320
gosub @ WEP_SWITCH_361
jump @ WEP_SWITCH_80

: WEP_SWITCH_151
wait 0
gosub @ WEP_SWITCH_197
gosub @ WEP_SWITCH_238
gosub @ WEP_SWITCH_279
gosub @ WEP_SWITCH_320
gosub @ WEP_SWITCH_361
jump @ WEP_SWITCH_151

: WEP_SWITCH_197
041A: 1 @ = actor $ PLAYER_ACTOR weapon 31 ammo
if and
key_down 53
  1 @> 0
else_jump @ WEP_SWITCH_236
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 31

: WEP_SWITCH_236
return

: WEP_SWITCH_238
041A: 1 @ = actor $ PLAYER_ACTOR weapon 30 ammo
if and
key_down 53
  1 @> 0
else_jump @ WEP_SWITCH_277
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 30

: WEP_SWITCH_277
return

: WEP_SWITCH_279
041A: 1 @ = actor $ PLAYER_ACTOR weapon 24 ammo
if and
key_down 50
  1 @> 0
else_jump @ WEP_SWITCH_318
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 24

: WEP_SWITCH_318
return

: WEP_SWITCH_320
041A: 1 @ = actor $ PLAYER_ACTOR weapon 25 ammo
if and
key_down 51
  1 @> 0
else_jump @ WEP_SWITCH_359
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 25

: WEP_SWITCH_359
return

: WEP_SWITCH_361
041A: 1 @ = actor $ PLAYER_ACTOR weapon 29 ammo
if and
key_down 52
  1 @> 0
else_jump @ WEP_SWITCH_400
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 29

: WEP_SWITCH_400
return



How can I implement
Код:
01B9: set_actor $ PLAYER_ACTOR weapon_weapon_to 0
in my code?

CLEO:
if
key_down 27
else_jump @SOMEWHERE_ELSE
01B9: set_actor $ PLAYER_ACTOR armed_weapon_to 0
set 27 to your desired keycode
 
  • Влюблен
Реакции: MarioK