updated header | readded double include prevention
This commit is contained in:
parent
16d8a7a210
commit
87b4d3570f
|
@ -1,10 +1,15 @@
|
|||
/* Vexd Utility backwards compatibility
|
||||
*
|
||||
* (c) 2004, the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _Vexd_Utilities_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _Vexd_Utilities_included
|
||||
|
||||
#include <engine>
|
||||
|
||||
stock Entvars_Get_Int(iIndex, iVariable)
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
/* AMX Mod X
|
||||
/* AMX Mod X constants
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _amxconst_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _amxconst_included
|
||||
|
||||
#define AMX_VERSION 0.1
|
||||
new AMX_VERSION_STR[] = "0.1"
|
||||
|
||||
/* Uncomment if you are not using Steam */
|
||||
//#define NO_STEAM
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* AMX Mod X misc.
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _amxmisc_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _amxmisc_included
|
||||
|
||||
stock cmd_access(id,level,cid,num) {
|
||||
if ( ((get_user_flags(id)&level)!=level) && (id!=(is_dedicated_server()?0:1)) ) {
|
||||
console_print(id,"You have no access to that command")
|
||||
|
@ -24,10 +29,10 @@ stock access(id,level)
|
|||
return (get_user_flags(id) & level)
|
||||
|
||||
/* Flags:
|
||||
* 1 - obey immunity
|
||||
* 2 - allow yourself
|
||||
* 4 - must be alive
|
||||
* 8 - can't be bot */
|
||||
* 1 - obey immunity
|
||||
* 2 - allow yourself
|
||||
* 4 - must be alive
|
||||
* 8 - can't be bot */
|
||||
stock cmd_target(id,const arg[],flags = 1) {
|
||||
new player = find_player("bl",arg)
|
||||
if (player) {
|
||||
|
|
|
@ -1,24 +1,30 @@
|
|||
/* AMX Mod X functions
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _amxmod_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _amxmod_included
|
||||
|
||||
#include <core>
|
||||
#include <float>
|
||||
#include <amxconst>
|
||||
#include <string>
|
||||
#include <file>
|
||||
#include <vault>
|
||||
#include <fun>
|
||||
|
||||
/* Function is called just after server activation.
|
||||
* Good place for configuration loading, commands and cvars registration. */
|
||||
* Good place for configuration loading, commands and cvars registration. */
|
||||
forward plugin_init();
|
||||
|
||||
/* Function is called when all plugin_init from plugins
|
||||
* were called, so all commmands and cvars should be already registered. */
|
||||
* were called, so all commmands and cvars should be already registered. */
|
||||
forward plugin_cfg();
|
||||
|
||||
/* Function called before plugin unloading (server deactivation) */
|
||||
|
@ -37,7 +43,7 @@ forward client_infochanged(id);
|
|||
forward client_connect(id);
|
||||
|
||||
/* Called when client gets valid STEAM id (usually
|
||||
* between client_connect() and client_putinserver()). */
|
||||
* between client_connect() and client_putinserver()). */
|
||||
forward client_authorized(id);
|
||||
|
||||
/* Called when client is disconnecting from server. */
|
||||
|
@ -53,7 +59,7 @@ forward client_putinserver(id);
|
|||
native register_plugin(const plugin_name[],const version[],const author[]);
|
||||
|
||||
/* Gets info about plugin by given index.
|
||||
* Function returns -1 if plugin doesn't exist with given index. */
|
||||
* Function returns -1 if plugin doesn't exist with given index. */
|
||||
native get_plugin(index,filename[],len1,name[],len2,version[],len3,author[],len4,status[],len5);
|
||||
|
||||
/* Returns number of all loaded plugins. */
|
||||
|
@ -78,8 +84,8 @@ native set_localinfo(const info[],const value[]);
|
|||
native get_localinfo(const info[],output[],len);
|
||||
|
||||
/* Shows text in MOTD window. When there is no header, the MOTD title
|
||||
* will be the name of server. If message is filename, then a contents
|
||||
* of this file will be displayed as MOTD. */
|
||||
* will be the name of server. If message is filename, then a contents
|
||||
* of this file will be displayed as MOTD. */
|
||||
native show_motd(player,const message[],const header[]="");
|
||||
|
||||
/* Sends message to player. Set index to 0 to send text globaly. */
|
||||
|
@ -95,27 +101,27 @@ native console_print(id,const message[],{Float,_}:...);
|
|||
native console_cmd(id,const cmd[],{Float,_}:...);
|
||||
|
||||
/* Registers event on which a given function will be called
|
||||
* Flags:
|
||||
* "a" - global event.
|
||||
* "b" - specified.
|
||||
* "c" - send only once when repeated to other players.
|
||||
* "d" - call if is send to dead player.
|
||||
* "e" - to alive.
|
||||
* Examples for conditions:
|
||||
* "2=c4" - 2nd parameter of message must be sting "c4".
|
||||
* "3>10" - 3rd parameter must be greater then 10.
|
||||
* "3!4" - 3rd must be different from 4.
|
||||
* "2&Buy" - 2nd parameter of message must contain "Buy" substring.
|
||||
* "2!Buy" - 2nd parameter of message can't contain "Buy" substring. */
|
||||
* Flags:
|
||||
* "a" - global event.
|
||||
* "b" - specified.
|
||||
* "c" - send only once when repeated to other players.
|
||||
* "d" - call if is send to dead player.
|
||||
* "e" - to alive.
|
||||
* Examples for conditions:
|
||||
* "2=c4" - 2nd parameter of message must be sting "c4".
|
||||
* "3>10" - 3rd parameter must be greater then 10.
|
||||
* "3!4" - 3rd must be different from 4.
|
||||
* "2&Buy" - 2nd parameter of message must contain "Buy" substring.
|
||||
* "2!Buy" - 2nd parameter of message can't contain "Buy" substring. */
|
||||
native register_event(const event[],const function[],const flags[],cond[]="", ... );
|
||||
|
||||
/* Registers log event on which the given function will be called
|
||||
* Examples for conditions:
|
||||
* "0=World triggered" "1=Game_Commencing"
|
||||
* "1=say"
|
||||
* "3=Terrorists_Win"
|
||||
* "1=entered the game"
|
||||
* "0=Server cvar" */
|
||||
* Examples for conditions:
|
||||
* "0=World triggered" "1=Game_Commencing"
|
||||
* "1=say"
|
||||
* "3=Terrorists_Win"
|
||||
* "1=entered the game"
|
||||
* "0=Server cvar" */
|
||||
native register_logevent(const function[], argsnum, ... );
|
||||
|
||||
/* Sets format for hudmessage. */
|
||||
|
@ -128,9 +134,9 @@ native show_hudmessage(index,const message[],{Float,_}:...);
|
|||
native show_menu(index,keys,const menu[], time = -1);
|
||||
|
||||
/* Gets value from client messages.
|
||||
* When you are asking for string the array and length is needed (read_data(2,name,len)).
|
||||
* Integer is returned by function (new me = read_data(3)).
|
||||
* Float is set in second parameter (read_data(3,value)). */
|
||||
* When you are asking for string the array and length is needed (read_data(2,name,len)).
|
||||
* Integer is returned by function (new me = read_data(3)).
|
||||
* Float is set in second parameter (read_data(3,value)). */
|
||||
native read_data(value, {Float,_}:... );
|
||||
|
||||
/* Returns number of values in client message. */
|
||||
|
@ -140,18 +146,18 @@ native read_datanum();
|
|||
native read_logdata(output[],len);
|
||||
|
||||
/* Returns number of log arguments.
|
||||
* Can be called only in plugin_log() forward function. */
|
||||
* Can be called only in plugin_log() forward function. */
|
||||
native read_logargc();
|
||||
|
||||
/* Gets log argument indexed from 0.
|
||||
* Can be called only in plugin_log() forward function. */
|
||||
* Can be called only in plugin_log() forward function. */
|
||||
native read_logargv(id,output[],len);
|
||||
|
||||
/* Parse log data about user ( "Butcher<5><BOT><TERRORIST>" etc. ). */
|
||||
native parse_loguser(const text[], name[], nlen, &userid = -2, authid[] = "", alen = 0, team[]="", tlen=0);
|
||||
|
||||
/* Prints message to server console.
|
||||
* You may use text formating (f.e. server_print("%-32s %.2f!","hello",7.345)) */
|
||||
* You may use text formating (f.e. server_print("%-32s %.2f!","hello",7.345)) */
|
||||
native server_print(const message[], {Float,_}:...);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
|
@ -179,13 +185,13 @@ native is_dedicated_server();
|
|||
native is_linux_server();
|
||||
|
||||
/* If player is not attacked function returns 0, in other
|
||||
* case returns index of attacking player. On second and third
|
||||
* parameter you may get info about weapon and body hit place. */
|
||||
* case returns index of attacking player. On second and third
|
||||
* parameter you may get info about weapon and body hit place. */
|
||||
native get_user_attacker(index,...);
|
||||
|
||||
/* If player doesn't hit at anything function returns 0.0,
|
||||
* in other case the distance between hit point and player is returned.
|
||||
* If player is aiming at another player then the id and part of body are set. */
|
||||
* in other case the distance between hit point and player is returned.
|
||||
* If player is aiming at another player then the id and part of body are set. */
|
||||
native Float:get_user_aiming(index,&id,&body,dist=9999);
|
||||
|
||||
/* Returns player frags. */
|
||||
|
@ -207,7 +213,7 @@ native get_user_index(const name[]);
|
|||
native get_user_ip(index,ip[],len, without_port = 0);
|
||||
|
||||
/* Returns id of currently carried weapon. Gets also
|
||||
* ammount of ammo in clip and backpack. */
|
||||
* ammount of ammo in clip and backpack. */
|
||||
native get_user_weapon(index,&clip,&ammo);
|
||||
|
||||
/* Gets ammo and clip from current weapon. */
|
||||
|
@ -217,27 +223,27 @@ native get_user_ammo(index,weapon,&clip,&ammo);
|
|||
native num_to_word(num,output[],len);
|
||||
|
||||
/* Returns team id. When length is greater then 0
|
||||
* then a name of team is set. */
|
||||
* then a name of team is set. */
|
||||
native get_user_team(index, team[]="", len = 0);
|
||||
|
||||
/* Returns player playing time in seconds.
|
||||
* If flag is set then result is without connection time. */
|
||||
* If flag is set then result is without connection time. */
|
||||
native get_user_time(index, flag = 0);
|
||||
|
||||
/* Gets ping and loss at current time. */
|
||||
native get_user_ping(index, &ping, &loss);
|
||||
|
||||
/* Gets origin from player.
|
||||
* Modes:
|
||||
* 0 - current position.
|
||||
* 1 - position from eyes (weapon aiming).
|
||||
* 2 - end position from player position.
|
||||
* 3 - end position from eyes (hit point for weapon).
|
||||
* 4 - position of last bullet hit (only CS). */
|
||||
* Modes:
|
||||
* 0 - current position.
|
||||
* 1 - position from eyes (weapon aiming).
|
||||
* 2 - end position from player position.
|
||||
* 3 - end position from eyes (hit point for weapon).
|
||||
* 4 - position of last bullet hit (only CS). */
|
||||
native get_user_origin(index, origin[3], mode = 0);
|
||||
|
||||
/* Returns all carried weapons as bit sum. Gets
|
||||
* also theirs indexes. */
|
||||
* also theirs indexes. */
|
||||
native get_user_weapons(index,weapons[32],&num);
|
||||
|
||||
/* Returns weapon name. */
|
||||
|
@ -268,19 +274,19 @@ native log_message(const message[],{Float,_}:...);
|
|||
native log_to_file(const file[],const message[],{Float,_}:...);
|
||||
|
||||
/* Returns number of players put in server.
|
||||
* If flag is set then also connecting are counted. */
|
||||
* If flag is set then also connecting are counted. */
|
||||
native get_playersnum(flag=0);
|
||||
|
||||
/* Sets indexes of players.
|
||||
* Flags:
|
||||
* "a" - don't collect dead players.
|
||||
* "b" - don't collect alive players.
|
||||
* "c" - skip bots.
|
||||
* "d" - skip real players.
|
||||
* "e" - match with team.
|
||||
* "f" - match with part of name.
|
||||
* "g" - ignore case sensitivity.
|
||||
* Example: Get all alive CTs: get_players(players,num,"ae","CT") */
|
||||
* Flags:
|
||||
* "a" - don't collect dead players.
|
||||
* "b" - don't collect alive players.
|
||||
* "c" - skip bots.
|
||||
* "d" - skip real players.
|
||||
* "e" - match with team.
|
||||
* "f" - match with part of name.
|
||||
* "g" - ignore case sensitivity.
|
||||
* Example: Get all alive CTs: get_players(players,num,"ae","CT") */
|
||||
native get_players(players[32], &num ,const flags[]="", const team[]="");
|
||||
|
||||
/* Gets argument from command. */
|
||||
|
@ -293,27 +299,27 @@ native read_args(output[],len);
|
|||
native read_argc();
|
||||
|
||||
/* Converts string to sum of bits.
|
||||
* Example: "abcd" is a sum of 1, 2, 4 and 8. */
|
||||
* Example: "abcd" is a sum of 1, 2, 4 and 8. */
|
||||
native read_flags(const flags[]);
|
||||
|
||||
/* Converts sum of bits to string.
|
||||
* Example: 3 will return "ab". */
|
||||
* Example: 3 will return "ab". */
|
||||
native get_flags(flags,output[],len);
|
||||
|
||||
/* Find player.
|
||||
* Flags:
|
||||
* "a" - with given name.
|
||||
* "b" - with given part of name.
|
||||
* "c" - with given authid.
|
||||
* "d" - with given ip.
|
||||
* "e" - with given team name.
|
||||
* "f" - don't look in dead players.
|
||||
* "g" - don't look in alive players.
|
||||
* "h" - skip bots.
|
||||
* "i" - skip real players.
|
||||
* "j" - return index of last found player.
|
||||
* "k" - with given userid.
|
||||
* "l" - ignore case sensitivity. */
|
||||
* Flags:
|
||||
* "a" - with given name.
|
||||
* "b" - with given part of name.
|
||||
* "c" - with given authid.
|
||||
* "d" - with given ip.
|
||||
* "e" - with given team name.
|
||||
* "f" - don't look in dead players.
|
||||
* "g" - don't look in alive players.
|
||||
* "h" - skip bots.
|
||||
* "i" - skip real players.
|
||||
* "j" - return index of last found player.
|
||||
* "k" - with given userid.
|
||||
* "l" - ignore case sensitivity. */
|
||||
native find_player(const flags[], ... );
|
||||
|
||||
/* Removes quotes from sentence. */
|
||||
|
@ -323,9 +329,9 @@ native remove_quotes(text[]);
|
|||
native client_cmd(index,const command[],{Float,_}:...);
|
||||
|
||||
/* This is an emulation of a client command (commands aren't send to client!).
|
||||
* It allows to execute some commands on players and bots.
|
||||
* Function is excellent for forcing to do an action related to a game (not settings!).
|
||||
* The command must stand alone but in arguments you can use spaces. */
|
||||
* It allows to execute some commands on players and bots.
|
||||
* Function is excellent for forcing to do an action related to a game (not settings!).
|
||||
* The command must stand alone but in arguments you can use spaces. */
|
||||
native engclient_cmd(index,const command[],arg1[]="",arg2[]="");
|
||||
|
||||
/* Executes command on a server console. */
|
||||
|
@ -338,11 +344,11 @@ native set_cvar_string(const cvar[],const value[]);
|
|||
native cvar_exists(const cvar[]);
|
||||
|
||||
/* Removes a cvar flags (not allowed for amx_version,
|
||||
* fun_version and sv_cheats cvars). */
|
||||
* fun_version and sv_cheats cvars). */
|
||||
native remove_cvar_flags(const cvar[],flags = -1);
|
||||
|
||||
/* Sets a cvar flags (not allowed for amx_version,
|
||||
* fun_version and sv_cheats cvars). */
|
||||
* fun_version and sv_cheats cvars). */
|
||||
native set_cvar_flags(const cvar[],flags);
|
||||
|
||||
/* Returns a cvar flags. */
|
||||
|
@ -382,39 +388,39 @@ native get_modname(name[],len);
|
|||
native get_time(const format[],output[],len);
|
||||
|
||||
/* Returns time in given format. The most popular is: "%m/%d/%Y - %H:%M:%S".
|
||||
* Last parameter sets time to format. */
|
||||
* Last parameter sets time to format. */
|
||||
native format_time(output[],len, const format[],time = -1);
|
||||
|
||||
/* Returns system time in seconds elapsed since 00:00:00 on January 1, 1970.
|
||||
* Offset is given in seconds.*/
|
||||
* Offset is given in seconds.*/
|
||||
native get_systime(offset = 0);
|
||||
|
||||
/* Returns time in input and additionaly fills missing information
|
||||
* with current time and date. If time is different than -1 then parsed
|
||||
* time is added to given time.
|
||||
* Example:
|
||||
* parset_time( "10:32:54 04/02/2003", "%H:%M:%S %m:%d:%Y" )
|
||||
* For more information see strptime(...) function from C libraries. */
|
||||
* with current time and date. If time is different than -1 then parsed
|
||||
* time is added to given time.
|
||||
* Example:
|
||||
* parset_time( "10:32:54 04/02/2003", "%H:%M:%S %m:%d:%Y" )
|
||||
* For more information see strptime(...) function from C libraries. */
|
||||
native parse_time(const input[],const format[], time = -1);
|
||||
|
||||
/* Calls function on specified time.
|
||||
* Flags:
|
||||
* "a" - repeat.
|
||||
* "b" - loop task.
|
||||
* "c" - do task on time after a map timeleft.
|
||||
* "d" - do task on time before a map timelimit. */
|
||||
* Flags:
|
||||
* "a" - repeat.
|
||||
* "b" - loop task.
|
||||
* "c" - do task on time after a map timeleft.
|
||||
* "d" - do task on time before a map timelimit. */
|
||||
native set_task(Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0);
|
||||
|
||||
/* Removes all tasks with given id. If outside var is
|
||||
* set then a task can be removed also when
|
||||
* was set in another plugin. */
|
||||
* set then a task can be removed also when
|
||||
* was set in another plugin. */
|
||||
native remove_task(id = 0, outside = 0);
|
||||
|
||||
/* Returns 1 if task under given id exists. */
|
||||
native task_exists(id = 0, outside = 0);
|
||||
|
||||
/* Sets flags for player. Set flags to -1 if you want to clear all flags.
|
||||
* You can use different settings by changing the id, which is from range 0 - 31. */
|
||||
* You can use different settings by changing the id, which is from range 0 - 31. */
|
||||
native set_user_flags(index,flags=-1,id=0);
|
||||
|
||||
/* Gets flags from player. Set index to 0 if you want to read flags from server. */
|
||||
|
@ -445,27 +451,27 @@ native get_srvcmd(index,server_cmd[],len1,&flags, info[],len2, flag);
|
|||
native get_srvcmdsnum(flag);
|
||||
|
||||
/* Gets info about console command. If id is set to 0,
|
||||
* then function returns only server cmds, if positive then
|
||||
* returns only client cmds. in other case returns all console commands. */
|
||||
* then function returns only server cmds, if positive then
|
||||
* returns only client cmds. in other case returns all console commands. */
|
||||
native get_concmd(index,cmd[],len1,&flags, info[],len2, flag, id = -1);
|
||||
|
||||
/* Returns number of registered console commands. */
|
||||
native get_concmdsnum(flag,id = -1);
|
||||
|
||||
/* Gets unique id of menu. Outside set to 1 allows
|
||||
* to catch menus outside a plugin where register_menuid is called. */
|
||||
* to catch menus outside a plugin where register_menuid is called. */
|
||||
native register_menuid(const menu[], outside=0 );
|
||||
|
||||
/* Calls function when player uses specified menu and proper keys. */
|
||||
native register_menucmd(menuid,keys, const function[] );
|
||||
|
||||
/* Gets what menu the player is watching and what keys for menu he have.
|
||||
* When there is no menu the index is 0. If the id is negative then the menu
|
||||
* is VGUI in other case the id is from register_menuid() function. */
|
||||
* When there is no menu the index is 0. If the id is negative then the menu
|
||||
* is VGUI in other case the id is from register_menuid() function. */
|
||||
native get_user_menu(index,&id,&keys);
|
||||
|
||||
/* Forces server to execute sent server command at current time.
|
||||
* Very useful for map changes, setting cvars and other activities. */
|
||||
* Very useful for map changes, setting cvars and other activities. */
|
||||
native server_exec();
|
||||
|
||||
/* Emits sound. Sample must be precached. */
|
||||
|
@ -484,34 +490,34 @@ native Float:random_float(Float:a,Float:b);
|
|||
native random_num(a,b);
|
||||
|
||||
/* Pauses function or plugin so it won't be executed.
|
||||
* In most cases param1 is name of function and
|
||||
* param2 name of plugin (all depends on flags).
|
||||
* Flags:
|
||||
* "a" - pause whole plugin.
|
||||
* "b" - pause function.
|
||||
* "c" - look outside the plugin (by given plugin name).
|
||||
* "d" - set "stopped" status when pausing whole plugin.
|
||||
* "e" - set "locked" status when pausing whole plugin.
|
||||
* In this status plugin is unpauseable.
|
||||
* Example: pause("ac","myplugin.amx")
|
||||
* pause("bc","myfunc","myplugin.amx") */
|
||||
* In most cases param1 is name of function and
|
||||
* param2 name of plugin (all depends on flags).
|
||||
* Flags:
|
||||
* "a" - pause whole plugin.
|
||||
* "b" - pause function.
|
||||
* "c" - look outside the plugin (by given plugin name).
|
||||
* "d" - set "stopped" status when pausing whole plugin.
|
||||
* "e" - set "locked" status when pausing whole plugin.
|
||||
* In this status plugin is unpauseable.
|
||||
* Example: pause("ac","myplugin.amx")
|
||||
* pause("bc","myfunc","myplugin.amx") */
|
||||
native pause(flag[], const param1[]="",const param2[]="");
|
||||
|
||||
/* Unpauses function or plugin.
|
||||
* Flags:
|
||||
* "a" - unpause whole plugin.
|
||||
* "b" - unpause function.
|
||||
* "c" - look outside the plugin (by given plugin name). */
|
||||
* Flags:
|
||||
* "a" - unpause whole plugin.
|
||||
* "b" - unpause function.
|
||||
* "c" - look outside the plugin (by given plugin name). */
|
||||
native unpause(flag[], const param1[]="",const param2[]="");
|
||||
|
||||
/* Returns id of client message.
|
||||
* Example: get_user_msgid("TextMsg"). */
|
||||
* Example: get_user_msgid("TextMsg"). */
|
||||
native get_user_msgid(const name[]);
|
||||
|
||||
/* These functinos are used to generate client messages.
|
||||
* You may generate menu, smoke, shockwaves, thunderlights,
|
||||
* intermission and many many others messages.
|
||||
* See HL SDK for more examples. */
|
||||
* You may generate menu, smoke, shockwaves, thunderlights,
|
||||
* intermission and many many others messages.
|
||||
* See HL SDK for more examples. */
|
||||
native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
|
||||
native message_end();
|
||||
native write_byte( x );
|
||||
|
@ -524,32 +530,32 @@ native write_coord( x );
|
|||
native write_string( x[] );
|
||||
|
||||
/* Called on inconsistent file. You can put any text
|
||||
* into reason to change an original message. */
|
||||
* into reason to change an original message. */
|
||||
forward inconsistent_file(id,const filename[], reason[64] );
|
||||
|
||||
/* Forces the client and server to be running with the same
|
||||
* version of the specified file ( e.g., a player model ). */
|
||||
* version of the specified file ( e.g., a player model ). */
|
||||
native force_unmodified(force_type, mins[3] , maxs[3], const filename[]);
|
||||
|
||||
/* Checks if public variable with given name exists in loaded plugins. */
|
||||
native xvar_exists( const name[] );
|
||||
|
||||
/* Returns an unique id for public variable specified by name. If such
|
||||
* variable doesn't exist then returned value is -1. */
|
||||
* variable doesn't exist then returned value is -1. */
|
||||
native get_xvar_id( const name[] );
|
||||
|
||||
/* Returns an integer value of a public variable. Id is a value
|
||||
* returned by get_xvar_id(...) native. */
|
||||
* returned by get_xvar_id(...) native. */
|
||||
native get_xvar_num( id );
|
||||
|
||||
/* Returns a float value of a public variable. Id is a value
|
||||
* returned by get_xvar_id(...) native. */
|
||||
* returned by get_xvar_id(...) native. */
|
||||
native Float:get_xvar_float( id );
|
||||
|
||||
/* Sets a value of a public variable. Id is a value
|
||||
* returned by get_xvar_id(...) native. */
|
||||
* returned by get_xvar_id(...) native. */
|
||||
native set_xvar_num( id, value = 0 );
|
||||
|
||||
/* Sets a float value of a public variable. Id is a value
|
||||
* returned by get_xvar_id(...) native. */
|
||||
* returned by get_xvar_id(...) native. */
|
||||
native set_xvar_float( id, Float:value = 0.0 );
|
|
@ -5,6 +5,11 @@
|
|||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _core_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _core_included
|
||||
|
||||
native heapspace();
|
||||
|
||||
native funcidx(const name[]);
|
||||
|
|
|
@ -1,51 +1,56 @@
|
|||
/* CS Stats functions
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _csstats_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _csstats_included
|
||||
|
||||
/* Gets stats from given weapon index. If wpnindex is 0
|
||||
* then the stats are from all weapons. If weapon has not been used function
|
||||
* returns 0 in other case 1. Fields in stats are:
|
||||
* 0 - kills
|
||||
* 1 - deaths
|
||||
* 2 - headshots
|
||||
* 3 - teamkilling
|
||||
* 4 - shots
|
||||
* 5 - hits
|
||||
* 6 - damage
|
||||
* For body hits fields see amxconst.inc. */
|
||||
* then the stats are from all weapons. If weapon has not been used function
|
||||
* returns 0 in other case 1. Fields in stats are:
|
||||
* 0 - kills
|
||||
* 1 - deaths
|
||||
* 2 - headshots
|
||||
* 3 - teamkilling
|
||||
* 4 - shots
|
||||
* 5 - hits
|
||||
* 6 - damage
|
||||
* For body hits fields see amxconst.inc. */
|
||||
native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets round stats from given weapon index.*/
|
||||
native get_user_wrstats(index,wpnindex,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets overall stats which are stored in file on server
|
||||
* and updated on every respawn or user disconnect.
|
||||
* Function returns the position in stats by diff. kills to deaths. */
|
||||
* and updated on every respawn or user disconnect.
|
||||
* Function returns the position in stats by diff. kills to deaths. */
|
||||
native get_user_stats(index,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets round stats of player. */
|
||||
native get_user_rstats(index,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets stats with which user have killed/hurt his victim. If victim is 0
|
||||
* then stats are from all victims. If victim has not been hurt, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
* then stats are from all victims. If victim has not been hurt, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0);
|
||||
|
||||
/* Gets stats with which user have been killed/hurt. If killer is 0
|
||||
* then stats are from all attacks. If killer has not hurt user, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
* then stats are from all attacks. If killer has not hurt user, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
native get_user_astats(index,wpnindex,stats[8],bodyhits[8],wpnname[]="",len=0);
|
||||
|
||||
/* Resets life, weapon, victims and attackers user stats. */
|
||||
native reset_user_wstats(index);
|
||||
|
||||
/* Gets overall stats which stored in stats.dat file in amx folder
|
||||
* and updated on every mapchange or user disconnect.
|
||||
* Function returns next index of stats entry or 0 if no more exists. */
|
||||
* and updated on every mapchange or user disconnect.
|
||||
* Function returns next index of stats entry or 0 if no more exists. */
|
||||
native get_stats(index,stats[8],bodyhits[8],name[],len);
|
||||
|
||||
/* Returns number of all entries in stats. */
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* Engine
|
||||
/* Engine functions
|
||||
*
|
||||
* (c) 2004, the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* thanks to Vexd
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _engine_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _engine_included
|
||||
|
||||
#include <engine_const>
|
||||
#include <engine_stocks>
|
||||
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
/* Engine Constants
|
||||
/* Engine constants
|
||||
*
|
||||
* (c) 2004, by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _engine_const_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _engine_const_included
|
||||
|
||||
#define SPEAK_NORMAL 0
|
||||
#define SPEAK_MUTED 1
|
||||
#define SPEAK_ALL 2
|
||||
|
@ -48,7 +53,7 @@ enum {
|
|||
EV_INT_iStepLeft,
|
||||
EV_INT_movetype,
|
||||
EV_INT_solid,
|
||||
EV_INT_skin,
|
||||
EV_INT_skin,
|
||||
EV_INT_body,
|
||||
EV_INT_effects,
|
||||
EV_INT_light_level,
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* Engine Stocks
|
||||
/* Engine stocks
|
||||
*
|
||||
* (c) 2004, AssKicR, Freecode & T(+)rget
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* thanks to AssKicR, Freecode and T(+)rget
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _engine_stocks_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _engine_stocks_included
|
||||
|
||||
/* Changes an integer vec to a floating vec */
|
||||
stock IVecFVec(IVec[3], Float:FVec[3])
|
||||
{
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
/* Files functions
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _file_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _file_included
|
||||
|
||||
/* Reads content from directory.
|
||||
* Returns index of next element or 0 when end of dir. is reached. */
|
||||
* Returns index of next element or 0 when end of dir. is reached. */
|
||||
native read_dir(const dirname[],pos,output[],len,&outlen);
|
||||
|
||||
/* Reads line from file. Returns index of next line or 0 when end of file is reached. */
|
||||
native read_file(const file[],line,text[],len,&txtlen);
|
||||
|
||||
/* Writes text to file. Function returns 0 on failure.
|
||||
* When line is set to -1, the text is added at the end of file. */
|
||||
* When line is set to -1, the text is added at the end of file. */
|
||||
native write_file(const file[],const text[],line = -1);
|
||||
|
||||
/* Deletes file. Function returns 1 on success, 0 on failure. */
|
||||
|
@ -24,7 +29,7 @@ native delete_file(const file[]);
|
|||
native file_exists(const file[]);
|
||||
|
||||
/* Returns a file size in bytes if flag is set to 0.
|
||||
* When flag is set to 1 returns number of lines in the file,
|
||||
* and when flags is 2, function returns 1 if the file ends
|
||||
* with line feed. If file doesn't exist returns -1. */
|
||||
* When flag is set to 1 returns number of lines in the file,
|
||||
* and when flags is 2, function returns 1 if the file ends
|
||||
* with line feed. If file doesn't exist returns -1. */
|
||||
native file_size(const file[], flag=0);
|
|
@ -47,8 +47,8 @@ native Float:floatfract(Float:value);
|
|||
native floatround(Float:value, floatround_method:method=floatround_round);
|
||||
|
||||
/* Compare two integers. If the two elements are equal, return 0.
|
||||
* If the first argument is greater than the second argument, return 1,
|
||||
* If the first argument is less than the second argument, return -1. */
|
||||
* If the first argument is greater than the second argument, return 1,
|
||||
* If the first argument is less than the second argument, return -1. */
|
||||
native floatcmp(Float:fOne, Float:fTwo);
|
||||
|
||||
/* Return the square root of the input value, same as floatpower(value, 0.5) */
|
||||
|
@ -61,7 +61,7 @@ native Float:floatpower(Float:value, Float:exponent);
|
|||
native Float:floatlog(Float:value, Float:base=10.0);
|
||||
|
||||
/* Return the sine, cosine or tangent.
|
||||
* The input angle may be in radian, degrees or grades. */
|
||||
* The input angle may be in radian, degrees or grades. */
|
||||
native Float:floatsin(Float:value, anglemode:mode=radian);
|
||||
native Float:floatcos(Float:value, anglemode:mode=radian);
|
||||
native Float:floattan(Float:value, anglemode:mode=radian);
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
/* Fun functions
|
||||
*
|
||||
* (c) 2004, the AMX Mod X Development Team
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _fun_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _fun_included
|
||||
|
||||
/* (untested) Returns 1 if receiver hears sender via voice communication. */
|
||||
native get_client_listen(receiver, sender);
|
||||
|
@ -33,21 +38,21 @@ native set_user_origin(index, origin[3]);
|
|||
native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16);
|
||||
|
||||
/* Gives item to player, name of item can start
|
||||
* with weapon_, ammo_ and item_. This event
|
||||
* is announced with proper message to all players. */
|
||||
* with weapon_, ammo_ and item_. This event
|
||||
* is announced with proper message to all players. */
|
||||
native give_item(index, const item[]);
|
||||
|
||||
/* (not yet implemented, don't know how to use native)
|
||||
* Sets hit zones for player. This event is announced
|
||||
* with proper message to all players.
|
||||
* Parts of body are as bits:
|
||||
* 2 - head
|
||||
* 4 - chest
|
||||
* 8 - stomach
|
||||
* 16 - left arm
|
||||
* 32 - right arm
|
||||
* 64 - left leg
|
||||
* 128 - right leg */
|
||||
* Sets hit zones for player. This event is announced
|
||||
* with proper message to all players.
|
||||
* Parts of body are as bits:
|
||||
* 2 - head
|
||||
* 4 - chest
|
||||
* 8 - stomach
|
||||
* 16 - left arm
|
||||
* 32 - right arm
|
||||
* 64 - left leg
|
||||
* 128 - right leg */
|
||||
native set_hitzones(body = 255);
|
||||
|
||||
/* backwards compatibility */
|
||||
|
@ -97,4 +102,4 @@ native get_user_noclip(index);
|
|||
|
||||
/* Gives player silent footsteps.
|
||||
* if set = 0 it will return footsteps to normal */
|
||||
native set_user_footsteps(id, set = 1);
|
||||
native set_user_footsteps(id, set = 1);
|
|
@ -1,14 +1,19 @@
|
|||
/* MySQL functions
|
||||
*
|
||||
* (c) Copyright 2002-2004, dJeyL
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _mysql_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _mysql_included
|
||||
|
||||
/* Opens connection. If already such exists then that will be used.
|
||||
* Function returns sql id to use with other sql natives.
|
||||
* Host can be plain ip or with port seperated with ':' char. */
|
||||
* Function returns sql id to use with other sql natives.
|
||||
* Host can be plain ip or with port seperated with ':' char. */
|
||||
native mysql_connect(host[],user[],pass[],dbname[],error[],maxlength);
|
||||
|
||||
/* Uses an existing connection (sql) to perform a new query (query) (might close previous query if any). */
|
||||
|
|
|
@ -1,29 +1,34 @@
|
|||
/* Strings manipulation
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _string_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _string_included
|
||||
|
||||
/* Checks if source contains string. On success function
|
||||
* returns position in source, on failure returns -1. */
|
||||
* returns position in source, on failure returns -1. */
|
||||
native contain(const source[],const string[]);
|
||||
|
||||
/* Checks if source contains string with case ignoring. On success function
|
||||
* returns position in source, on failure returns -1. */
|
||||
* returns position in source, on failure returns -1. */
|
||||
native containi(const source[],const string[]);
|
||||
|
||||
/* Replaces given string to another in given text. */
|
||||
native replace(text[],len,const what[],const with[]);
|
||||
|
||||
/* Adds one string to another. Last parameter different from 0, specifies
|
||||
* how many chars we want to add. Function returns number of all merged chars. */
|
||||
* how many chars we want to add. Function returns number of all merged chars. */
|
||||
native add(dest[],len,const src[],max=0);
|
||||
|
||||
/* Fills string with given format and parameters.
|
||||
* Function returns number of copied chars.
|
||||
* Example: format(dest,"Hello %s. You are %d years old","Tom",17). */
|
||||
* Function returns number of copied chars.
|
||||
* Example: format(dest,"Hello %s. You are %d years old","Tom",17). */
|
||||
native format(output[] ,len ,const format[] , {Float,_}:...);
|
||||
|
||||
/* Gets parameters from function as formated string. */
|
||||
|
@ -38,29 +43,29 @@ native str_to_num(const string[]);
|
|||
native strtonum(const string[]);
|
||||
|
||||
/* Checks if two strings equal. If len var is set
|
||||
* then there are only c chars comapred. */
|
||||
* then there are only c chars comapred. */
|
||||
native equal(const a[],const b[],c=0);
|
||||
|
||||
/* Checks if two strings equal with case ignoring.
|
||||
* If len var is set then there are only c chars comapred. */
|
||||
* If len var is set then there are only c chars comapred. */
|
||||
native equali(const a[],const b[],c=0);
|
||||
|
||||
/* Copies one string to another. By len var
|
||||
* you may specify max. number of chars to copy. */
|
||||
* you may specify max. number of chars to copy. */
|
||||
native copy(dest[],len,const src[]);
|
||||
|
||||
/* Copies one string to another until char ch is found.
|
||||
* By len var you may specify max. number of chars to copy. */
|
||||
* By len var you may specify max. number of chars to copy. */
|
||||
native copyc(dest[],len,const src[],ch);
|
||||
|
||||
/* Sets string with given character. */
|
||||
native setc(src[],len,ch);
|
||||
|
||||
/* Gets parameters from text.
|
||||
* Example: to split text: "^"This is^" the best year",
|
||||
* call function like this: parse(text,arg1,len1,arg2,len2,arg3,len3,arg4,len4)
|
||||
* and you will get: "This is", "the", "best", "year"
|
||||
* Function returns number of parsed parameters. */
|
||||
* Example: to split text: "^"This is^" the best year",
|
||||
* call function like this: parse(text,arg1,len1,arg2,len2,arg3,len3,arg4,len4)
|
||||
* and you will get: "This is", "the", "best", "year"
|
||||
* Function returns number of parsed parameters. */
|
||||
native parse(const text[], ... );
|
||||
|
||||
/* Converts all chars in string to lower case. */
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
/* Vault
|
||||
/* Vault functions
|
||||
*
|
||||
* (c) 2002-2004, OLO
|
||||
* modified by the AMX Mod X Development Team
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _vault_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _vault_included
|
||||
|
||||
/* Reads a data from given key.
|
||||
* If len is set to zero then get_vaultdata
|
||||
* returns value as an number. */
|
||||
* If len is set to zero then get_vaultdata
|
||||
* returns value as an number. */
|
||||
native get_vaultdata(const key[], data[] = "", len = 0);
|
||||
|
||||
/* Sets a data under given key. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user