/* Vexd Utility Module Core
*
* by the AMX Mod Dev Team
*
* This file is provided as is (no warranties).
*/

#if defined _vexdum_included
  #endinput
#endif
#define _vexdum_included

#include <VexdUM_const>

// Sets a user model, Model would be "vip" for the vip model. By default it clears the model. set_user_model(id)
native set_user_model(id, const Model[]="");

// Set Model (TFC)
native TFC_SetModel(id, const Model[], const Skin[]);

// Clear Model (TFC)
native TFC_ClearModel(id);

// Set Player's View to entity Index.
native attach_view(id, ent);

// Set Player's Speak Flags.
native set_speak(id, iSpeakFlags, target=0);

// Get Player's Speak Flags.
native get_speak(id, target=0);

// Set map lighting, #OFF to disable.
native set_lights(const Lighting[]);

// Get & Set things in an entities Entvars Struct. See HLSDK or look at examples to determine what different variables do.
native entity_get_int(ent, iVar);
native entity_set_int(ent, iVar, iVal);
native Float:entity_get_float(ent, iVar); 
native entity_set_float(ent, iVar, Float:fVal);
native entity_get_vector(ent, iVar, Float:vVal[3]);
native entity_set_vector(ent, iVar, Float:vVal[3]);
native entity_get_edict(ent, iVar);
native entity_set_edict(ent, iVar, iEnt);
native entity_get_string(ent, iVar, szVal[], iLen); 
native entity_set_string(ent, iVar, szVal[]);
native entity_get_byte(ent, iVar);
native entity_set_byte(ent, iVar, iVal);

// Get things in globalvars Struct. See HLSDK or look at examples to determine what different variables do.
native global_get_int(iVar);
native Float:global_get_float(iVar);
native global_get_vector(iVar, Float:vVal[3]);
native global_get_edict(iVar);
native global_get_string(iVar, szVal[], iLen);

// Get & Set things in a players TraceLine Struct. See HLSDK or look at examples to determine what different variables do.
native traceline_get_int(iVar);
native traceline_set_int(iVar, iVal);
native Float:traceline_get_float(iVar);
native traceline_set_float(iVar, Float:fVal);
native traceline_get_vector(iVar, Float:vVal[3]);
native traceline_set_vector(iVar, Float:vVal[3]);
native traceline_get_edict(iVar);
native traceline_set_edict(iVar, iEnt);

// Some Damage functions
native radius_damage(inflictor, Float:dmg, Float:orig[3], Float:rad, bit = DMG_BULLET, wpnName[]="", hs = 0);
native take_damage(victim, attacker, Float:orig[3], Float:dmg, bit = DMG_BULLET, wpnName[]="", hs = 0);
native client_death(victim, attacker, wpnName[]="", hs = 0);

// Will return the contents of a point (inside map? in sky? outside map? etc.)
native PointContents(Float:fCheckAt[3]);

// Creates an entity, will return the index of the created entity. ClassName must be valid.
native create_entity(szClassname[]);

// Dispatch a KeyValuePair, used for initalizing entities when a map spawns them.
native DispatchKeyValue(ent, szKey[], szValue[]);

// Runs the GameDLL's DispatchSpawn for an entity, I think it's used with DispatchKeyValue.
native DispatchSpawn(ent);

// Sets the model of an Entity.
native entity_set_model(ent, szModel[]);

// Proper origin setting, keeps updated with Half-Life engine.
native entity_set_origin(ent, Float:Orig[3]);

// Sets the Bounding Box Size of an entity.
native entity_set_size(ent, Float:vecMin[3], Float:vecMax[3]);

// Find an entity in the world, will return -1 if nothing is found
// type = 0: "classname"
// type = 1: "globalname"
// type = 2: "model"
// type = 3: "target"
// type = 4: "targetname"
// type = 5: "netname"
// type = 6: "message"
// type = 7: "noise"
// type = 8: "noise1"
// type = 9: "noise2"
// type = 10: "noise3"
// type = 11: "viewmodel"
// type = 12: "weaponmodel"
native find_entity(ent, szValue[], type=0);

// Find an entity within a given origin and radius
native find_entity_sphere(ent, Float:Orig[3], Float:Rad);

// Remove an entity from the world
native remove_entity(ent);

// Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3]
// Will return an entindex if an entity is hit.
native trace_line(ent, Float:fStart[3], Float:fEnd[3], Float:vRtn[3]);

// Traces a hull.
native trace_hull(Float:fOrigin[3], hull, ignoredent=0, ignoremonsters=0);

// Traces a line, and returns the normal to the plane hit in vReturn.
// Returns 0 if theres no normal.
native trace_normal(ent, Float:fStart[3], Float:fEnd[3], Float:vRtn[3]);

// Traces what texture an entity is looking at or standing on. set 0 = Trace Forward, set 1 = Trace Below
native trace_texture(ent, szBuf[], iLen, set = 0);

// Traces result
native trace_result(type, {Float,_}:...);

// Set/Get What Engine Messages Are Blocked.
native set_msg_block(iMessage, iMessageFlags);
native get_msg_block(iMessage);

// Precache event
native precache_event(type, szEvent[]);

// Playback a precached event
native playback_event(flags,invoker,eventindex,Float:delay,Float:origin[3],Float:angles[3],Float:fparam1,Float:fparam2,iparam1,iparam2,bparam1,bparam2);

// Gets a integer from index's pvPrivateData at offset.
native get_offset_int(ent, offset, linos = 5);

// Sets a integer value in index's pvPrivateData at offset.
native set_offset_int(ent, offset, value, linos = 5);

// Gets number of ents in a map
native get_num_ents();

// Returns maxentities setting
native get_maxentities();

// Checks if index is an existing ent
native is_entity(ent);

// Get whole buffer containing keys and their data
native get_info_keybuffer(id, szBuffer[], length);

// Get keyvalue from the entity
native get_keyvalue(ent, szKey[], szValue[], length);

// Copy keyvalue when keyvalue forward is called
native copy_keyvalue(szClassName[], iLen1, szKeyName[], iLen2, szValue[], iLen3);

// Sets keyvalue on a player
native set_client_keyvalue(id, szKey[], szValue[]);

// Get decal index
native get_decal_index(const szDecalName[]);

// Fake one entity touching another.
native fake_touch(ent1, ent2);

// CBaseEntity::Think() from the entity
native call_think(entity);

// Bot Natives
native create_bot(name[]);
native remove_bot(id);
native control_bot(id, Float:vAngles[3], Float:fMove, Float:sMove, Float:uMove, Buttons, Impulse, mSec);

// Some Misc natives
native dot_points(Float:vSrc[3], Float:vCheck[3], Float:vDir[3]);
native Float:dot_product(Float:vecA[3], Float:vecB[3]);
native normalize(Float:vVec[3], Float:vRet[3]);
native can_see(ent1, ent2);
native in_view_cone(ent, Float:Orig[3]);
native drop_to_floor(ent);
native entity_use(eUsed, eOther);
native index_to_pointer(index);
native pointer_to_index(pointer);

// Called once every server frame.
forward server_frame();

// Called when 2 entities touch.
forward entity_touch(entity1, entity2);

// Called on an entity's DispatchThink
forward entity_think(entity);

// Called when an entity is spawned
forward entity_spawn(entity);

// Called before the engine calculates player movement, etc.
forward client_prethink(id);

// Called after the engine has calculated player movement
forward client_postthink(id);

// Called when a client types kill in console
forward client_kill(id);

// Called when an Emitting Sound is played Server-Side
forward emitsound(entity, const sample[]);

// Called when an Emitting Ambient Sound is played Server-Side
forward emitambientsound(entity, const sample[]);

// Called when a model spawns
forward set_model(entity, const model[]);

// Called whatever an entity looks at
forward traceline(entity);

// Called when a monster is hurt by VexdUM damage natives
forward monster_hurt(monster, attacker, damage);

// Called when a keyvalue is set on a player
forward setclientkeyvalue(id, key[], value[]);

// Called when an entity gets a keyvalue set on it from the engine.
// Use copy_keyvalue to get the keyvalue information
forward keyvalue(entity);

// Include the Stock Functions
// #include <VexdUM_stock>
