Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Client_Cmd errorI tried to make variety from client_cmd command, but something went wrong

perk

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
6 odpowiedzi w tym temacie

#1 MasamuneDate

    Pomocny

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:60
  • Imię:Nat Davin
  • Lokalizacja:INDONESIA
Offline

Napisano 01.05.2020 03:10

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


  • +
  • -
  • 0

#2 dredek

    Wszechobecny

  • Użytkownik

Reputacja: 162
Profesjonalista

  • Postów:476
  • GG:
  • Imię:Dawid
  • Lokalizacja:OLK
Offline

Napisano 01.05.2020 14:20

try this

Załączone pliki


  • +
  • -
  • 0

#3 MasamuneDate

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:60
  • Imię:Nat Davin
  • Lokalizacja:INDONESIA
Offline

Napisano 02.05.2020 09:33

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


  • +
  • -
  • 0

#4 Rivit

    Godlike

  • Support Team

Reputacja: 1 319
Godlike

  • Postów:4 380
Offline

Napisano 02.05.2020 10:41

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

  • +
  • -
  • 0

#5 MasamuneDate

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:60
  • Imię:Nat Davin
  • Lokalizacja:INDONESIA
Offline

Napisano 03.05.2020 19:55

 

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

  • +
  • -
  • 0

#6 Rivit

    Godlike

  • Support Team

Reputacja: 1 319
Godlike

  • Postów:4 380
Offline

Napisano 03.05.2020 21:40


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.


  • +
  • -
  • 0

#7 MasamuneDate

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 1
Nowy

  • Postów:60
  • Imię:Nat Davin
  • Lokalizacja:INDONESIA
Offline

Napisano 04.05.2020 17:04

 


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 ;)

  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: perk

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych