/* DoDXMod functions
 *
 * (c) 2003, SidLuke
 * This file is provided as is (no warranties).
 */

#if defined _dodxmod_included
  #endinput
#endif
#define _dodxmod_included

#include <dodconst>
#include <dodstats>

/* Function is called after player to player attacks,
* if player was damaged by teammate TA is set to 1 */
forward damage_info(attacker,victim,damage,wpnindex,hitplace,TA);

/* Function is called after player death,
* if player was killed by teammate TK is set to 1 */
forward death_info(killer,victim,wpnindex,hitplace,TK);

/* Function is called if player scored */
forward score_info(index,score,total);

/* Function is called after grenade throw */
forward grenade_throw(index,greindex,wId);

/* function will return 1 if true */
native dod_is_melee(wpnindex);

/* Returns weapon name. */
native dod_get_wpnname(wpnindex,name[],len);

/* Returns weapon logname. */
native dod_get_wpnlogname(wpnindex,name[],len);

/* weapon logname to weapon name conversion */
native dod_wpnlog_to_name(logname[],name[],len);

/* weapon logname to weapon index conversion */
native dod_wpnlog_to_id(logname[]);

/* Returns team score */
native dod_get_team_score(teamId);

/* Returns player class id */
native dod_get_user_class(index);

/* Sets player class */
native dod_set_user_class(index,classId);

/* Returns next player class. Useful if player is using random class */
native dod_get_next_class(index);

/* Returns 1 if player chose random class */
native dod_is_randomclass(index);

/* Returns player team id
* When length is greater than 0 then a name of team is set. */
native dod_get_user_team(index,team[]="",len=0);

/* Sets player team and random class. */
native dod_set_user_team(index,teamId,refresh=1);

/* Returns player score */
native dod_get_user_score(index);

/* Sets player score. */
native dod_set_user_score(index,value,refresh=1);

/* Returns player deaths */
native dod_get_user_deaths(index);

/* Sets player deaths. */
native dod_set_user_deaths(index,value,refresh=1);

/* Returns player kills. */
native dod_get_user_kills(index);

/* Sets player kills. */
native dod_set_user_kills(index,value,refresh=1);

/* Returns id of currently carried weapon. Gets also
* amount of ammo in clip and backpack. */
native dod_get_user_weapon(index,&clip,&ammo);

/* values are: 0-no prone, 1-prone, 2-prone+w_deploy */
native dod_get_pronestate(index);

/* Returns 1 if player weapon is deployed (bar, mg..) */
native dod_is_deployed(index);

/* It is not as safe as original but player deaths will not be increased */
native dod_user_kill(index);

/* Returns 1 if UK, 0 if US */
native detect_allies_team();

/* if allies players are paratroopers function will return 1 */
native detect_allies_paras();

/* if axis players are paratroopers function will return 1 */
native detect_axis_paras();

/* Example: for full stamina use set_player_stamina(id,100,100) */
/* value is from 0 - 100 */
native set_user_stamina(index,minvalue=0,maxvalue=100);

/* Resets stamina to normal */
native reset_user_stamina(index);

/* Sets fuse for grenades. Valid number is from 0.1-20.0 */
/* types : new or old, see dodconst.inc */
native nade_set_fuse(index,Float:newFuse=5.0,Type=FT_NEW);

/* Resets fuse for grenades */
native nade_reset_fuse(index);

/******************************************************************************/

stock is_melee(wpnindex)
  return dod_is_melee(wpnindex)
  
stock get_wpnname(wpnindex,name[],len)
  return dod_get_wpnname(wpnindex,name[],len)
  
stock get_wpnlogname(wpnindex,name[],len)
  return dod_get_wpnlogname(wpnindex,name[],len)
  
stock wpnlog_to_name(logname[],name[],len)
  return dod_wpnlog_to_name(logname[],name[],len)
  
stock wpnlog_to_id(logname[])
  return dod_wpnlog_to_id(logname[])
  
stock dod_get_pl_deaths(index)
  return dod_get_user_deaths(index)

stock dod_set_pl_deaths(index,value,refresh=1)
  return dod_set_user_deaths(index,value,refresh)
  
stock user_kill2(index)
  return dod_user_kill(index)
  
stock get_user_pronestate(index)
  return dod_get_pronestate(index)
