←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

[CoD] Flash dłużej razi

Locked

  • +
  • -
Scoti's Photo Scoti 08.09.2010

Witam. Mam takie pytanie odnośnie flasha. Mam klasę "Flasher" i chcę zrobić aby jego flash raził 2 sekundy dlużej. Proszę o pomoc jak to zrobić. Dam +.
Quote

  • +
  • -
DarkMatrix975's Photo DarkMatrix975 08.09.2010

Chyba to nie jest wykonywalne zobacze
Quote

  • +
  • -
Scoti's Photo Scoti 08.09.2010

DarkMatrix975, zdaje mi sie że był taki plugin który przedłużał flasha. Myśle że to jest wykonalne.
Quote

  • +
  • -
R3X's Photo R3X 08.09.2010

new const giLonger = (1<<12);
tu podajesz o ile dłuższy ma być flash, (1<<12) to sekunda,

2sekundy to (1<<12)*2 == (1<<13)
3sekudny to (1<<12)*3
4sekundy to (1<<12)*4 == (1<<14)
itd

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "longerFlash"
#define VERSION "1.0"
#define AUTHOR "R3X"

new const giLonger = (1<<12);

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_message(get_user_msgid("ScreenFade"), "messageScreenFade");
}
public messageScreenFade(msgtype, msgid, id){
	//if(klasa_gracza[id] != Flasher) return PLUGIN_CONTINUE;
	if(get_msg_arg_int(4) == 255 && get_msg_arg_int(5) == 255 && get_msg_arg_int(6) == 255 && get_msg_arg_int(7) > 199){
		set_msg_arg_int(1, ARG_SHORT, get_msg_arg_int(1) + giLonger);
		set_msg_arg_int(2, ARG_SHORT, get_msg_arg_int(2) + giLonger);
	}
	return PLUGIN_CONTINUE;
}
Quote

hardbot's Photo hardbot 08.09.2010

A tutaj SMA i AMXX jak by ktoś nie umiał Kompilować xP

Attached Files

Quote

  • +
  • -
Scoti's Photo Scoti 09.09.2010

A jak dodać to do klasy w modzie Call Of Duty?
Quote

  • +
  • -
Kusek's Photo Kusek 09.09.2010

register_message(get_user_msgid("ScreenFade"), "messageScreenFade");

to do plugint_init na końcu najlepiej dać ;P


potem do na koniec całego kodu, ale oczywiście nad klamrami zakończenowymi

public messageScreenFade(msgtype, msgid, id){
//if(klasa_gracza[id] != Flasher) return PLUGIN_CONTINUE;
if(get_msg_arg_int(4) == 255 && get_msg_arg_int(5) == 255 && get_msg_arg_int(6) == 255 && get_msg_arg_int(7) > 199){
set_msg_arg_int(1, ARG_SHORT, get_msg_arg_int(1) + giLonger);
set_msg_arg_int(2, ARG_SHORT, get_msg_arg_int(2) + giLonger);
}
return PLUGIN_CONTINUE;
}

aby miała to klasa to usuwasz "//" z przed linij
	//if(klasa_gracza[id] != Flasher) return PLUGIN_CONTINUE;


potem
new const giLonger = (1<<12);

dodaje to na górę np. po doswiadczenie_za_pake czy jak to tam się nazywa xD
Quote

  • +
  • -
Scoti's Photo Scoti 09.09.2010

Skompilowało się. Łap +. Jednak sprawdzę w poniedziałek czy działa bo wtedy będę miał możliwość. Dzięki.
Quote
Locked