This is my library for keyall.c
DOWNLOAD:
http://www.mediafire.com/download/mmv7qb8zpmsl7jv/key_lib.zip
USAGE:
combo(int p, char combo_id, int ETA, int hold_btn_combo_flag, char btn1, char btn2, char btn3, ...)
- returns 1 is the combo is completed, else returns 0
PARAMS:
int p: Player index
char combo_id: Combo ID (string)
int ETA: time between two button pression
int hold_btn_combo_flag: hold button flag (the same of playerkeys())
char btn1, char btn2, char btn3, ...: buttons
ACCEPTED BUTTONS:
forward, backward, up, down, attack,
attack2, attack3, attack4, jump,
special, start, esc, screenshot
and the function accepts multipple buttons like
"attack+attack2" or "attack+jump+special"
Example:
Code:
if ( getentityproperty(getplayerproperty(p,"entity"),"exists") ) {
void player = getplayerproperty(p,"entity");
if( combo(p,"combo01",0,1,"forward","up","attack+attack2") ) {
char anim = "ANI_FOLLOW42";
if ( ready_to_attack(player,1,0,NULL()) ) {
changeentityproperty(player,"velocity",0,0,0);
performattack(player,openborconstant(anim),1);
}
}
}
int playerkeys_multi(int p, int hold_flag, char key_string)
- return 1 if all buttons are pressed, 2 if button are partially pressed and 0 if buttons aren't pressed. it works like playerkeys()
ex. playerkeys_multi(0, 0, "attack+jump") returns 1 if player 1 hold
attack+jump+special together
and it returns 2 is player 1 hold only attack or jump. It accepts also more
then two buttons like: "attack+jump+special"
int get_hold_time(int p, char key)
- returns the hold button time.
ex. get_hold_time(0, "attack") returns the hold button time for player 1.
int is_multi_hold_pressed(int p, char btn1, char btn2, char btn3, ...)
- returns is more than 1 button is pressed
ex. is_multi_hold_pressed(0,"attack","jump") returns 1 if the player 1 holds attack and jump button togheter, returns 0 else.