Client_Cmd error
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
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
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
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
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
- id - player index
- perk (to be more specific - perk ID, unique identifier (number))
- perk value - like i said before - this is the magic 'LW'
- info - if 0 info about changing perk would be not printed, if 1 it will be printed
- 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.
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
- id - player index
- perk (to be more specific - perk ID, unique identifier (number))
- perk value - like i said before - this is the magic 'LW'
- info - if 0 info about changing perk would be not printed, if 1 it will be printed
- 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