←  Multilingual

AMXX.pl: Support AMX Mod X i SourceMod

»

Client_Cmd error

  • +
  • -
MasamuneDate - zdjęcie MasamuneDate 01.05.2020

So, i try the class generator, and i make a variety from it. I used the "1/X function" to drop enemy weapons.

So, i change the "client_cmd(id, "drop")", into "client_cmd(id, "say /drop;say /drop2")"

 

But the problem is, someone saying that this cause them to drop their own weapons ! Any suggestion ?

Załączone pliki

Odpowiedz

  • +
  • -
dredek - zdjęcie dredek 01.05.2020

try this

Załączone pliki

Odpowiedz

  • +
  • -
MasamuneDate - zdjęcie MasamuneDate 02.05.2020

try this

 

Sorry, but im not trying to drop the weapons.

 

So the problem is, what i want is to drop the enemy "perk". Whilist that command instead, it drop weapons instead of perk. So, what i want is, when i hit enemy with anything, it has 1/X chance to drop both of enemy perk ( by saying /drop and /drop2 ).

 

But the problem is, when i do (client_cmd(id, "say /drop;say /drop2")) , it immediately drop my own perk, instead of enemy. Thats the problem

Odpowiedz

  • +
  • -
Rivit - zdjęcie Rivit 02.05.2020

instead of 

client_cmd(id, "say /drop;say /drop2");

use

cod_set_user_perk(id, 0, -1, 0);

if you use two slots for perk it might be necessary to add 5th parameter to cod_set_user_perk, for example:

cod_set_user_perk(id, 0, -1, 0, 0);

last parameter:

  • 0 - first perk
  • 1 - second
Odpowiedz

  • +
  • -
MasamuneDate - zdjęcie MasamuneDate 03.05.2020

 

instead of 

client_cmd (id, "say / drop; say / drop2");

use

cod_set_user_perk (id, 0, -1, 0);

if you use two slots for perk it might be necessary to add 5th parameter to cod_set_user_perk, for example:

cod_set_user_perk (id, 0, -1, 0, 0);

last parameter:

  • 0 - first perk
  • 1 - second

 

 

but i want to ask, what is the -1 ? Is it the second perk ? I still dont quite understand

 

*Note about perk

So, the original COD Mod only able to say /perk, i modified it so you can carry 2 perk at a time. Before : only /perk, after : /perk and /perk2.


Użytkownik MasamuneDate edytował ten post 03.05.2020 19:58
Odpowiedz

  • +
  • -
Rivit - zdjęcie Rivit 03.05.2020


So, the original COD Mod only able to say /perk, i modified it so you can carry 2 perk at a time. Before : only /perk, after : /perk and /perk2.

 

I know.

 

 


if you use two slots for perk it might be necessary to add 5th parameter to cod_set_user_perk

 


last parameter:

0 - first perk
1 - second

 

 

 


but i want to ask, what is the -1 ? Is it the second perk ? I still dont quite understand

-1 is the value of perk. I mean this is the 'LW' in the following line of code:

new const perk_desc[] = "1 / LW Chance to discard opponent perk when hit. ( BOTH PERK )";

If you use cod_set_user_perk(id, 0, -1, 0, 0); to reset user perk it does not matter which value you set.

Parameters in cod_set_user_perk

  1. id - player index
  2. perk (to be more specific - perk ID, unique identifier (number))
  3. perk value - like i said before - this is the magic 'LW'
  4. info - if 0 info about changing perk would be not printed, if 1 it will be printed
  5. perk slot, 0 - first, 1 - second | NOTE: this is only if you have cod mod with two slots for perk.

NOTE: perk with id = 0 is "no perk", just empty slot.

Odpowiedz

  • +
  • -
MasamuneDate - zdjęcie MasamuneDate 04.05.2020

 


So, the original COD Mod only able to say / perk, i modified it so you can carry 2 perk at a time. Before: only / perk, after: / perk and / perk2.

 

I know.

 

 

 

 


if you use two slots for perk it might be necessary to add 5th parameter to cod_set_user_perk

 

 

 


last parameter:

0 - first perk
1 - second

 

 

 

 

 


but i want to ask, what is the -1? Is it the second perk? I still dont quite understand

-1 is the value of perk. I mean this is the 'LW' in the following line of code:

new const perk_desc [] = "1 / LW Chance to discard opponent perk when hit. (BOTH PERK)";

If you use  cod_set_user_perk ( id , 0 , - 1 , 0 , 0 ); to reset user perk it does not matter which value you set.

Parameters in cod_set_user_perk

  1. id - player index
  2. perk (to be more specific - perk ID, unique identifier (number))
  3. perk value - like i said before - this is the magic 'LW'
  4. info - if 0 info about changing perk would be not printed, if 1 it will be printed
  5. perk slot, 0 - first, 1 - second | NOTE: this is only if you have cod mod with two slots for perk.

NOTE: perk with id = 0 is "no perk", just empty slot.

 

 

okay thanks man ! I will try it as soon as i can

 

Thanks for your help


dasiek (11.05.2020 07:16):
if everything is going to be ok, report post, or Mark it as resolved ;)
Odpowiedz