Initial revision
This commit is contained in:
205
plugins/include/amxconst.inc
Executable file
205
plugins/include/amxconst.inc
Executable file
@ -0,0 +1,205 @@
|
||||
/* AMX Mod
|
||||
*
|
||||
* (c) 2002-2003, OLO
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _amxconst_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _amxconst_included
|
||||
|
||||
// Uncomment if you are not using Steam
|
||||
//#define NO_STEAM
|
||||
|
||||
#define ADMIN_IMMUNITY (1<<0) /* flag "a" */
|
||||
#define ADMIN_RESERVATION (1<<1) /* flag "b" */
|
||||
#define ADMIN_KICK (1<<2) /* flag "c" */
|
||||
#define ADMIN_BAN (1<<3) /* flag "d" */
|
||||
#define ADMIN_SLAY (1<<4) /* flag "e" */
|
||||
#define ADMIN_MAP (1<<5) /* flag "f" */
|
||||
#define ADMIN_CVAR (1<<6) /* flag "g" */
|
||||
#define ADMIN_CFG (1<<7) /* flag "h" */
|
||||
#define ADMIN_CHAT (1<<8) /* flag "i" */
|
||||
#define ADMIN_VOTE (1<<9) /* flag "j" */
|
||||
#define ADMIN_PASSWORD (1<<10) /* flag "k" */
|
||||
#define ADMIN_RCON (1<<11) /* flag "l" */
|
||||
#define ADMIN_LEVEL_A (1<<12) /* flag "m" */
|
||||
#define ADMIN_LEVEL_B (1<<13) /* flag "n" */
|
||||
#define ADMIN_LEVEL_C (1<<14) /* flag "o" */
|
||||
#define ADMIN_LEVEL_D (1<<15) /* flag "p" */
|
||||
#define ADMIN_LEVEL_E (1<<16) /* flag "q" */
|
||||
#define ADMIN_LEVEL_F (1<<17) /* flag "r" */
|
||||
#define ADMIN_LEVEL_G (1<<18) /* flag "s" */
|
||||
|
||||
#define ADMIN_LEVEL_H (1<<19) /* flag "t" */
|
||||
#define ADMIN_MENU (1<<20) /* flag "u" */
|
||||
#define ADMIN_USER (1<<25) /* flag "z" */
|
||||
|
||||
#define FLAG_KICK (1<<0) /* flag "a" */
|
||||
#define FLAG_TAG (1<<1) /* flag "b" */
|
||||
#define FLAG_AUTHID (1<<2) /* flag "c" */
|
||||
#define FLAG_IP (1<<3) /* flag "d" */
|
||||
#define FLAG_NOPASS (1<<4) /* flag "e" */
|
||||
|
||||
#define PLUGIN_CONTINUE 0 /* Results returned by public functions */
|
||||
#define PLUGIN_HANDLED 1 /* stop other plugins */
|
||||
#define PLUGIN_HANDLED_MAIN 2 /* to use in client_command(), continue all plugins but stop the command */
|
||||
|
||||
/* Destination types for message_begin() */
|
||||
#define MSG_BROADCAST 0 /* unreliable to all */
|
||||
#define MSG_ONE 1 /* reliable to one (msg_entity) */
|
||||
#define MSG_ALL 2 /* reliable to all */
|
||||
#define MSG_INIT 3 /* write to the init string */
|
||||
#define MSG_PVS 4 /* Ents in PVS of org */
|
||||
#define MSG_PAS 5 /* Ents in PAS of org */
|
||||
#define MSG_PVS_R 6 /* Reliable to PVS */
|
||||
#define MSG_PAS_R 7 /* Reliable to PAS */
|
||||
#define MSG_ONE_UNRELIABLE 8 /* Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) */
|
||||
#define MSG_SPEC 9 /* Sends to all spectator proxies */
|
||||
|
||||
/* Message types for message_begin() */
|
||||
#define SVC_TEMPENTITY 23
|
||||
#define SVC_INTERMISSION 30
|
||||
#define SVC_CDTRACK 32
|
||||
#define SVC_WEAPONANIM 35
|
||||
#define SVC_ROOMTYPE 37
|
||||
#define SVC_ADDANGLE 38 /* [vec3] add this angle to the view angle */
|
||||
#define SVC_NEWUSERMSG 39
|
||||
#define SVC_HLTV 50
|
||||
|
||||
/* Flags for register_cvar() */
|
||||
#define FCVAR_ARCHIVE 1 /* set to cause it to be saved to vars.rc */
|
||||
#define FCVAR_USERINFO 2 /* changes the client's info string */
|
||||
#define FCVAR_SERVER 4 /* notifies players when changed */
|
||||
#define FCVAR_EXTDLL 8 /* defined by external DLL */
|
||||
#define FCVAR_CLIENTDLL 16 /* defined by the client dll */
|
||||
#define FCVAR_PROTECTED 32 /* It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value */
|
||||
#define FCVAR_SPONLY 64 /* This cvar cannot be changed by clients connected to a multiplayer server. */
|
||||
#define FCVAR_PRINTABLEONLY 128 /* This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). */
|
||||
#define FCVAR_UNLOGGED 256 /* If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log */
|
||||
|
||||
|
||||
/* Id of weapons in CS */
|
||||
#define CSW_P228 1
|
||||
#define CSW_SCOUT 3
|
||||
#define CSW_HEGRENADE 4
|
||||
#define CSW_XM1014 5
|
||||
#define CSW_C4 6
|
||||
#define CSW_MAC10 7
|
||||
#define CSW_AUG 8
|
||||
#define CSW_SMOKEGRENADE 9
|
||||
#define CSW_ELITE 10
|
||||
#define CSW_FIVESEVEN 11
|
||||
#define CSW_UMP45 12
|
||||
#define CSW_SG550 13
|
||||
#define CSW_GALI 14
|
||||
#define CSW_FAMAS 15
|
||||
#define CSW_USP 16
|
||||
#define CSW_GLOCK18 17
|
||||
#define CSW_AWP 18
|
||||
#define CSW_MP5NAVY 19
|
||||
#define CSW_M249 20
|
||||
#define CSW_M3 21
|
||||
#define CSW_M4A1 22
|
||||
#define CSW_TMP 23
|
||||
#define CSW_G3SG1 24
|
||||
#define CSW_FLASHBANG 25
|
||||
#define CSW_DEAGLE 26
|
||||
#define CSW_SG552 27
|
||||
#define CSW_AK47 28
|
||||
#define CSW_KNIFE 29
|
||||
#define CSW_P90 30
|
||||
|
||||
/* Parts of body for hits */
|
||||
#define HIT_GENERIC 0 /* none */
|
||||
#define HIT_HEAD 1
|
||||
#define HIT_CHEST 2
|
||||
#define HIT_STOMACH 3
|
||||
#define HIT_LEFTARM 4
|
||||
#define HIT_RIGHTARM 5
|
||||
#define HIT_LEFTLEG 6
|
||||
#define HIT_RIGHTLEG 7
|
||||
|
||||
/* Constants for emit_sound() */
|
||||
/* Channels */
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
#define CHAN_VOICE 2
|
||||
#define CHAN_ITEM 3
|
||||
#define CHAN_BODY 4
|
||||
#define CHAN_STREAM 5 /* allocate stream channel from the static or dynamic area */
|
||||
#define CHAN_STATIC 6 /* allocate channel from the static area */
|
||||
#define CHAN_NETWORKVOICE_BASE 7 /* voice data coming across the network */
|
||||
#define CHAN_NETWORKVOICE_END 500 /* network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). */
|
||||
|
||||
/* Attenuation values */
|
||||
#define ATTN_NONE 0.00
|
||||
#define ATTN_NORM 0.80
|
||||
#define ATTN_IDLE 2.00
|
||||
#define ATTN_STATIC 1.25
|
||||
|
||||
/* Pitch values */
|
||||
#define PITCH_NORM 100 /* non-pitch shifted */
|
||||
#define PITCH_LOW 95 /* other values are possible - 0-255, where 255 is very high */
|
||||
#define PITCH_HIGH 120
|
||||
|
||||
|
||||
/* Volume values */
|
||||
#define VOL_NORM 1.0
|
||||
|
||||
/* Destination types for client_print() */
|
||||
enum {
|
||||
print_notify = 1,
|
||||
print_console,
|
||||
print_chat,
|
||||
print_center,
|
||||
}
|
||||
|
||||
/* Destination types for engclient_print() */
|
||||
enum {
|
||||
engprint_console = 0,
|
||||
engprint_center,
|
||||
engprint_chat,
|
||||
}
|
||||
|
||||
/* Render for set_user_rendering() */
|
||||
enum {
|
||||
kRenderNormal, /* src */
|
||||
kRenderTransColor, /* c*a+dest*(1-a) */
|
||||
kRenderTransTexture, /* src*a+dest*(1-a) */
|
||||
kRenderGlow, /* src*a+dest -- No Z buffer checks */
|
||||
kRenderTransAlpha, /* src*srca+dest*(1-srca) */
|
||||
kRenderTransAdd, /* src*a+dest */
|
||||
}
|
||||
|
||||
/* Fx for set_user_rendering() */
|
||||
enum {
|
||||
kRenderFxNone = 0,
|
||||
kRenderFxPulseSlow,
|
||||
kRenderFxPulseFast,
|
||||
kRenderFxPulseSlowWide,
|
||||
kRenderFxPulseFastWide,
|
||||
kRenderFxFadeSlow,
|
||||
kRenderFxFadeFast,
|
||||
kRenderFxSolidSlow,
|
||||
kRenderFxSolidFast,
|
||||
kRenderFxStrobeSlow,
|
||||
kRenderFxStrobeFast,
|
||||
kRenderFxStrobeFaster,
|
||||
kRenderFxFlickerSlow,
|
||||
kRenderFxFlickerFast,
|
||||
kRenderFxNoDissipation,
|
||||
kRenderFxDistort, /* Distort/scale/translate flicker */
|
||||
kRenderFxHologram, /* kRenderFxDistort + distance fade */
|
||||
kRenderFxDeadPlayer, /* kRenderAmt is the player index */
|
||||
kRenderFxExplode, /* Scale up really big! */
|
||||
kRenderFxGlowShell, /* Glowing Shell */
|
||||
kRenderFxClampMinScale, /* Keep this sprite from getting very small (SPRITES only!) */
|
||||
}
|
||||
|
||||
enum {
|
||||
force_exactfile, /* File on client must exactly match server's file */
|
||||
force_model_samebounds, /* For model files only, the geometry must fit in the same bbox */
|
||||
force_model_specifybounds, /* For model files only, the geometry must fit in the specified bbox */
|
||||
}
|
104
plugins/include/amxmisc.inc
Executable file
104
plugins/include/amxmisc.inc
Executable file
@ -0,0 +1,104 @@
|
||||
/* AMX Mod misc.
|
||||
*
|
||||
* (c) 2002-2003, OLO
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _amxmisc_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _amxmisc_included
|
||||
|
||||
stock cmd_access(a,b,c,d){
|
||||
if ( ((get_user_flags(a)&b)!=b) && (a!=(is_dedicated_server()?0:1)) ){
|
||||
console_print(a,"You have no access to that command")
|
||||
return 0
|
||||
}
|
||||
if (read_argc() < d){
|
||||
new hcmd[32], hinfo[128], hflag
|
||||
get_concmd(c,hcmd,31,hflag,hinfo,127,b)
|
||||
console_print(a,"Usage: %s %s",hcmd,hinfo)
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
stock cmd_target(id,const arg[],flags = 1) {
|
||||
new player = find_player("bl",arg)
|
||||
if (player){
|
||||
if ( player != find_player("blj",arg) ){
|
||||
console_print(id,"There are more clients matching to your argument")
|
||||
return 0
|
||||
}
|
||||
}
|
||||
else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] )
|
||||
player = find_player("k",strtonum(arg[1]))
|
||||
if (!player){
|
||||
console_print(id,"Client with that name or userid not found")
|
||||
return 0
|
||||
}
|
||||
if (flags & 1){
|
||||
if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) ){
|
||||
new imname[32]
|
||||
get_user_name(player,imname,31)
|
||||
console_print(id,"Client ^"%s^" has immunity",imname)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if (flags & 4){
|
||||
if (!is_user_alive(player)){
|
||||
new imname[32]
|
||||
get_user_name(player,imname,31)
|
||||
console_print(id,"That action can't be performed on dead client ^"%s^"",imname)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
if (flags & 8){
|
||||
if (is_user_bot(player)){
|
||||
new imname[32]
|
||||
get_user_name(player,imname,31)
|
||||
console_print(id,"That action can't be performed on bot ^"%s^"",imname)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
return player
|
||||
}
|
||||
|
||||
stock show_activity( id, const name[], {Float,_}: ... ){
|
||||
new buffer[128]
|
||||
format_args( buffer , 127 , 2 )
|
||||
switch(get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%s %s: %s",
|
||||
(get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN" , name , buffer )
|
||||
case 1: client_print(0,print_chat,"%s: %s",
|
||||
(get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN", buffer )
|
||||
}
|
||||
}
|
||||
|
||||
stock is_running(const arg[]){
|
||||
new mod_name[32]
|
||||
get_modname(mod_name,31)
|
||||
return equal(mod_name,arg)
|
||||
}
|
||||
|
||||
stock build_path( path[] , len , {Float,_}:... ) {
|
||||
new basedir[32]
|
||||
get_localinfo( "amx_basedir", basedir , 31 )
|
||||
format_args( path , len , 2 )
|
||||
return replace( path , len , "$basedir", basedir )
|
||||
}
|
||||
|
||||
stock get_basedir( name[], len )
|
||||
return get_localinfo( "amx_basedir", name , len )
|
||||
|
||||
stock get_logfile( name[], len )
|
||||
return get_time("admin%m%d.log",name,len)
|
560
plugins/include/amxmod.inc
Executable file
560
plugins/include/amxmod.inc
Executable file
@ -0,0 +1,560 @@
|
||||
/* AMX Mod functions
|
||||
*
|
||||
* (c) 2002-2003, 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 <fun>
|
||||
#include <vault>
|
||||
|
||||
/* Function is called just after server activation.
|
||||
* 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. */
|
||||
forward plugin_cfg();
|
||||
|
||||
/* Function called before plugin unloading (server deactivation) */
|
||||
forward plugin_end();
|
||||
|
||||
/* Called on log message. */
|
||||
forward plugin_log();
|
||||
|
||||
/* Use here model_precache() and sound_precache() functions. */
|
||||
forward plugin_precache();
|
||||
|
||||
/* Whenever player info is changed, this function is called. */
|
||||
forward client_infochanged(id);
|
||||
|
||||
/* Called on client connection. */
|
||||
forward client_connect(id);
|
||||
|
||||
/* Called when client gets valid STEAM id (usually
|
||||
* between client_connect() and client_putinserver()). */
|
||||
forward client_authorized(id);
|
||||
|
||||
/* Called when client is disconnecting from server. */
|
||||
forward client_disconnect(id);
|
||||
|
||||
/* Called when client is sending command. */
|
||||
forward client_command(id);
|
||||
|
||||
/* Called when client is entering to a game. */
|
||||
forward client_putinserver(id);
|
||||
|
||||
/* Sets informations about plugin. */
|
||||
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. */
|
||||
native get_plugin(index,filename[],len1,name[],len2,version[],len3,author[],len4,status[],len5);
|
||||
|
||||
/* Returns number of all loaded plugins. */
|
||||
native get_pluginsnum();
|
||||
|
||||
/* Precache model. Can be used only in plugin_precache() function.*/
|
||||
native precache_model(const name[]);
|
||||
|
||||
/* Precache sound. Can be used only in plugin_precache() function.*/
|
||||
native precache_sound(const name[]);
|
||||
|
||||
/* Sets info for player. */
|
||||
native set_user_info(index,const info[],const value[]);
|
||||
|
||||
/* Gets info from player. */
|
||||
native get_user_info(index,const info[],output[],len);
|
||||
|
||||
/* Sets info for server. */
|
||||
native set_localinfo(const info[],const value[]);
|
||||
|
||||
/* Gets info from server. */
|
||||
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. */
|
||||
native show_motd(player,const message[],const header[]="");
|
||||
|
||||
/* Sends message to player. Set index to 0 to send text globaly. */
|
||||
native client_print(index,type,const message[],{Float,_}:...);
|
||||
|
||||
/* Sends message to player by engine. Set index to 0 to send text globaly. */
|
||||
native engclient_print(player,type,const message[],{Float,_}:...);
|
||||
|
||||
/* Sends message to console. */
|
||||
native console_print(id,const message[],{Float,_}:...);
|
||||
|
||||
/* Sends command to console. */
|
||||
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. */
|
||||
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"
|
||||
*/
|
||||
native register_logevent(const function[], argsnum, ... );
|
||||
|
||||
/* Sets format for hudmessage. */
|
||||
native set_hudmessage(red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2,channel=4);
|
||||
|
||||
/* Displays HUD message to given player. */
|
||||
native show_hudmessage(index,const message[],{Float,_}:...);
|
||||
|
||||
/* Displays menu. Keys have bit values (key 1 is (1<<0), key 5 is (1<<4) etc.). */
|
||||
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)). */
|
||||
native read_data(value, {Float,_}:... );
|
||||
|
||||
/* Returns number of values in client message. */
|
||||
native read_datanum();
|
||||
|
||||
/* Gets log message. Can be called only in plugin_log() forward function. */
|
||||
native read_logdata(output[],len);
|
||||
|
||||
/* Returns number of log arguments.
|
||||
* 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. */
|
||||
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)) */
|
||||
native server_print(const message[], {Float,_}:...);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_map_valid(const mapname[]);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_user_bot(index);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_user_hltv(index);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_user_connected(index);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_user_connecting(index);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_user_alive(index);
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
native is_dedicated_server();
|
||||
|
||||
/* Returns 1 or 0. */
|
||||
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. */
|
||||
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. */
|
||||
native Float:get_user_aiming(index,&id,&body,dist=9999);
|
||||
|
||||
/* Returns player frags. */
|
||||
native get_user_frags(index);
|
||||
|
||||
/* Returns player deaths. */
|
||||
native get_user_deaths(index);
|
||||
|
||||
/* Returns player armor. */
|
||||
native get_user_armor(index);
|
||||
|
||||
/* Returns player health. */
|
||||
native get_user_health(index);
|
||||
|
||||
/* Returns index. */
|
||||
native get_user_index(const name[]);
|
||||
|
||||
/* Returns ip. */
|
||||
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. */
|
||||
native get_user_weapon(index,&clip,&ammo);
|
||||
|
||||
/* Gets ammo and clip from current weapon. */
|
||||
native get_user_ammo(index,weapon,&clip,&ammo);
|
||||
|
||||
/* Converts numbers from range 0 - 999 to words. */
|
||||
native num_to_word(num,output[],len);
|
||||
|
||||
/* Returns team id. When length is greater then 0
|
||||
* 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. */
|
||||
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). */
|
||||
native get_user_origin(index, origin[3], mode = 0);
|
||||
|
||||
/* Returns all carried weapons as bit sum. Gets
|
||||
* also theirs indexes. */
|
||||
native get_user_weapons(index,weapons[32],&num);
|
||||
|
||||
/* Returns weapon name. */
|
||||
native get_weaponname(id,weapon[],len);
|
||||
|
||||
/* Returns player name. */
|
||||
native get_user_name(index,name[],len);
|
||||
|
||||
/* Gets player authid. */
|
||||
native get_user_authid(index, authid[] ,len);
|
||||
|
||||
/* Returns player wonid. */
|
||||
native get_user_wonid(index);
|
||||
|
||||
/* Returns player userid. */
|
||||
native get_user_userid(index);
|
||||
|
||||
/* Slaps player with given power. */
|
||||
native user_slap(index,power,rnddir=1);
|
||||
|
||||
/* Kills player. When flag is set to 1 then death won't decrase frags. */
|
||||
native user_kill(index,flag=0);
|
||||
|
||||
/* Sends message to standard HL logs. */
|
||||
native log_message(const message[],{Float,_}:...);
|
||||
|
||||
/* Sends log message to specified file. */
|
||||
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. */
|
||||
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") */
|
||||
native get_players(players[32], &num ,const flags[]="", const team[]="");
|
||||
|
||||
/* Gets argument from command. */
|
||||
native read_argv(id,output[],len);
|
||||
|
||||
/* Gets line of all arguments. */
|
||||
native read_args(output[],len);
|
||||
|
||||
/* Returns number of arguments (+ one as command). */
|
||||
native read_argc();
|
||||
|
||||
/* Converts string to sum of bits.
|
||||
* 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". */
|
||||
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. */
|
||||
native find_player(const flags[], ... );
|
||||
|
||||
/* Removes quotes from sentence. */
|
||||
native remove_quotes(text[]);
|
||||
|
||||
/* Executes command on player. */
|
||||
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. */
|
||||
native engclient_cmd(index,const command[],arg1[]="",arg2[]="");
|
||||
|
||||
/* Executes command on a server console. */
|
||||
native server_cmd(const command[],{Float,_}:...);
|
||||
|
||||
/* Sets a cvar to given value. */
|
||||
native set_cvar_string(const cvar[],const value[]);
|
||||
|
||||
/* If a cvar exists returns 1, in other case 0 */
|
||||
native cvar_exists(const cvar[]);
|
||||
|
||||
/* Removes a cvar flags (not allowed for amx_version,
|
||||
* 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). */
|
||||
native set_cvar_flags(const cvar[],flags);
|
||||
|
||||
/* Returns a cvar flags. */
|
||||
native get_cvar_flags(const cvar[]);
|
||||
|
||||
/* Sets a cvar to given float. */
|
||||
native set_cvar_float(const cvar[],Float:value);
|
||||
|
||||
/* Gets a cvar float. */
|
||||
native Float:get_cvar_float(const cvarname[]);
|
||||
|
||||
/* Gets a cvar integer value. */
|
||||
native get_cvar_num(const cvarname[]);
|
||||
|
||||
/* Sets a cvar with integer value. */
|
||||
native set_cvar_num(const cvarname[],value);
|
||||
|
||||
/* Reads a cvar value. */
|
||||
native get_cvar_string(const cvarname[],output[],iLen);
|
||||
|
||||
/* Returns a name of currently played map. */
|
||||
native get_mapname(name[],len);
|
||||
|
||||
/* Returns time remaining on map in seconds. */
|
||||
native get_timeleft();
|
||||
|
||||
/* Returns a game time. */
|
||||
native Float:get_gametime();
|
||||
|
||||
/* Returns maxplayers setting. */
|
||||
native get_maxplayers();
|
||||
|
||||
/* Returns a name of currently played mod. */
|
||||
native get_modname(name[],len);
|
||||
|
||||
/* Returns time in given format. The most popular is: "%m/%d/%Y - %H:%M:%S". */
|
||||
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. */
|
||||
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.*/
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
native get_user_flags(index,id=0);
|
||||
|
||||
/* Removes flags for player. */
|
||||
native remove_user_flags(index,flags=-1,id=0);
|
||||
|
||||
/* Registers function which will be called from client console. */
|
||||
native register_clcmd(const client_cmd[],const function[],flags=-1, info[]="");
|
||||
|
||||
/* Registers function which will be called from any console. */
|
||||
native register_concmd(const cmd[],const function[],flags=-1, info[]="");
|
||||
|
||||
/* Registers function which will be called from server console. */
|
||||
native register_srvcmd(const server_cmd[],const function[],flags=-1, info[]="");
|
||||
|
||||
/* Gets info about client command. */
|
||||
native get_clcmd(index, command[], len1, &flags, info[], len2, flag);
|
||||
|
||||
/* Returns number of registered client commands. */
|
||||
native get_clcmdsnum(flag);
|
||||
|
||||
/* Gets info about server command. */
|
||||
native get_srvcmd(index,server_cmd[],len1,&flags, info[],len2, flag);
|
||||
|
||||
/* Returns number of registered server commands. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
native server_exec();
|
||||
|
||||
/* Emits sound. Sample must be precached. */
|
||||
native emit_sound(index, channel, sample[], Float:vol, Float:att,flags, pitch);
|
||||
|
||||
/* Returns distance between two vectors. */
|
||||
native get_distance(origin1[3],origin2[3]);
|
||||
|
||||
/* Registers new cvar for HL engine. */
|
||||
native register_cvar(const name[],const string[],flags = 0,Float:fvalue = 0.0);
|
||||
|
||||
/* Generates random floating point number from a to b. */
|
||||
native Float:random_float(Float:a,Float:b);
|
||||
|
||||
/* Generates random integer from a to 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") */
|
||||
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). */
|
||||
native unpause(flag[], const param1[]="",const param2[]="");
|
||||
|
||||
/* Returns id of client message.
|
||||
* 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. */
|
||||
native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
|
||||
native message_end();
|
||||
native write_byte( x );
|
||||
native write_char( x );
|
||||
native write_short( x );
|
||||
native write_long( x );
|
||||
native write_entity( x );
|
||||
native write_angle( x );
|
||||
native write_coord( x );
|
||||
native write_string( x[] );
|
||||
|
||||
/* Called on inconsistent file. You can put any text
|
||||
* 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 ). */
|
||||
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. */
|
||||
native get_xvar_id( const name[] );
|
||||
|
||||
/* Returns an integer value of a public variable. Id is a value
|
||||
* 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. */
|
||||
native Float:get_xvar_float( id );
|
||||
|
||||
/* Sets a value of a public variable. Id is a value
|
||||
* 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. */
|
||||
native set_xvar_float( id, Float:value = 0.0 );
|
39
plugins/include/core.inc
Executable file
39
plugins/include/core.inc
Executable file
@ -0,0 +1,39 @@
|
||||
/* Core functions
|
||||
*
|
||||
* (c) Copyright 1998-2002, ITB CompuPhase
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
#if defined _core_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _core_included
|
||||
|
||||
native heapspace();
|
||||
|
||||
native funcidx(const name[]);
|
||||
|
||||
native numargs();
|
||||
native getarg(arg, index=0);
|
||||
native setarg(arg, index=0, value);
|
||||
|
||||
native strlen(const string[]);
|
||||
native strpack(dest[], const source[]);
|
||||
native strunpack(dest[], const source[]);
|
||||
|
||||
native tolower(c);
|
||||
native toupper(c);
|
||||
native swapchars(c);
|
||||
|
||||
native random(max);
|
||||
|
||||
native min(value1, value2);
|
||||
native max(value1, value2);
|
||||
native clamp(value, min=cellmin, max=cellmax);
|
||||
|
||||
native power(value, exponent);
|
||||
native sqroot(value);
|
||||
|
||||
native time(&hour=0,&minute=0,&second=0);
|
||||
native date(&year=0,&month=0,&day=0);
|
||||
|
||||
native tickcount(&granularity=0);
|
55
plugins/include/csstats.inc
Executable file
55
plugins/include/csstats.inc
Executable file
@ -0,0 +1,55 @@
|
||||
/* CS Stats functions
|
||||
*
|
||||
* (c) 2002-2003, 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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
native get_stats(index,stats[8],bodyhits[8],name[],len);
|
||||
|
||||
/* Returns number of all entries in stats. */
|
||||
native get_statsnum();
|
34
plugins/include/file.inc
Executable file
34
plugins/include/file.inc
Executable file
@ -0,0 +1,34 @@
|
||||
/* Files functions
|
||||
*
|
||||
* (c) 2002-2003, 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. */
|
||||
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. */
|
||||
native write_file(const file[],const text[],line = -1);
|
||||
|
||||
/* Deletes file. Function returns 1 on success, 0 on failure. */
|
||||
native delete_file(const file[]);
|
||||
|
||||
/* Checks for file. If file exists function returns 1, in other case 0. */
|
||||
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.*/
|
||||
native file_size(const file[], flag=0);
|
122
plugins/include/float.inc
Executable file
122
plugins/include/float.inc
Executable file
@ -0,0 +1,122 @@
|
||||
/* Float arithmetic
|
||||
*
|
||||
* (c) Copyright 1999, Artran, Inc.
|
||||
* Written by Greg Garner (gmg@artran.com)
|
||||
* Modified in March 2001 to include user defined
|
||||
* operators for the floating point functions.
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _float_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _float_included
|
||||
|
||||
native Float:float(value);
|
||||
native Float:floatstr(const string[]);
|
||||
native Float:floatmul(Float:oper1, Float:oper2);
|
||||
native Float:floatdiv(Float:dividend, Float:divisor);
|
||||
native Float:floatadd(Float:dividend, Float:divisor);
|
||||
native Float:floatsub(Float:oper1, Float:oper2);
|
||||
native Float:floatfract(Float:value);
|
||||
|
||||
enum floatround_method {
|
||||
floatround_round,
|
||||
floatround_floor,
|
||||
floatround_ceil
|
||||
}
|
||||
|
||||
native floatround(Float:value, floatround_method:method=floatround_round);
|
||||
native floatcmp(Float:fOne, Float:fTwo);
|
||||
|
||||
#pragma rational Float
|
||||
|
||||
/* user defined operators */
|
||||
native Float:operator*(Float:oper1, Float:oper2) = floatmul;
|
||||
native Float:operator/(Float:oper1, Float:oper2) = floatdiv;
|
||||
native Float:operator+(Float:oper1, Float:oper2) = floatadd;
|
||||
native Float:operator-(Float:oper1, Float:oper2) = floatsub;
|
||||
|
||||
stock Float:operator++(Float:oper)
|
||||
return oper+1.0;
|
||||
|
||||
stock Float:operator--(Float:oper)
|
||||
return oper-1.0;
|
||||
|
||||
stock Float:operator-(Float:oper)
|
||||
return oper^Float:0x80000000; /* IEEE values are sign/magnitude */
|
||||
|
||||
stock Float:operator*(Float:oper1, oper2)
|
||||
return floatmul(oper1, float(oper2)); /* "*" is commutative */
|
||||
|
||||
stock Float:operator/(Float:oper1, oper2)
|
||||
return floatdiv(oper1, float(oper2));
|
||||
|
||||
stock Float:operator/(oper1, Float:oper2)
|
||||
return floatdiv(float(oper1), oper2);
|
||||
|
||||
stock Float:operator+(Float:oper1, oper2)
|
||||
return floatadd(oper1, float(oper2)); /* "+" is commutative */
|
||||
|
||||
stock Float:operator-(Float:oper1, oper2)
|
||||
return floatsub(oper1, float(oper2));
|
||||
|
||||
stock Float:operator-(oper1, Float:oper2)
|
||||
return floatsub(float(oper1), oper2);
|
||||
|
||||
stock bool:operator==(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) == 0;
|
||||
|
||||
stock bool:operator==(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator!=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) != 0;
|
||||
|
||||
stock bool:operator!=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) != 0; /* "==" is commutative */
|
||||
|
||||
stock bool:operator>(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) > 0;
|
||||
|
||||
stock bool:operator>(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) > 0;
|
||||
|
||||
stock bool:operator>(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) > 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) >= 0;
|
||||
|
||||
stock bool:operator>=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) >= 0;
|
||||
|
||||
stock bool:operator>=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) >= 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) < 0;
|
||||
|
||||
stock bool:operator<(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) < 0;
|
||||
|
||||
stock bool:operator<(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) < 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, Float:oper2)
|
||||
return floatcmp(oper1, oper2) <= 0;
|
||||
|
||||
stock bool:operator<=(Float:oper1, oper2)
|
||||
return floatcmp(oper1, float(oper2)) <= 0;
|
||||
|
||||
stock bool:operator<=(oper1, Float:oper2)
|
||||
return floatcmp(float(oper1), oper2) <= 0;
|
||||
|
||||
stock bool:operator!(Float:oper)
|
||||
return floatcmp(oper, 0.0) == 0;
|
||||
|
||||
/* forbidden operations */
|
||||
forward operator%(Float:oper1, Float:oper2);
|
||||
forward operator%(Float:oper1, oper2);
|
||||
forward operator%(oper1, Float:oper2);
|
86
plugins/include/fun.inc
Executable file
86
plugins/include/fun.inc
Executable file
@ -0,0 +1,86 @@
|
||||
/* Fun functions
|
||||
*
|
||||
* (c) 2002-2003, OLO
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _fun_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _fun_included
|
||||
|
||||
/* Sets who can listen who. Function returns 0
|
||||
* if for some reasons this setting can't be done. */
|
||||
native set_user_listening(receiver,sender,listen);
|
||||
|
||||
/* Returns 1 if receiver hears sender via voice communication. */
|
||||
native get_user_listening(receiver,sender);
|
||||
|
||||
/* Sets player godmode. If you want to disable godmode set only first parameter. */
|
||||
native set_user_godmode(index,godmode = 0);
|
||||
|
||||
/* Returns 1 if godmode is set. */
|
||||
native get_user_godmode(index);
|
||||
|
||||
/* Sets player noclip. If you want to disable noclip set only first parameter. */
|
||||
native set_user_noclip(index,noclip = 0);
|
||||
|
||||
/* Returns 1 if noclip is set. */
|
||||
native get_user_noclip(index);
|
||||
|
||||
/* Sets player frags. */
|
||||
native set_user_frags(index,frags);
|
||||
|
||||
/* Sets player armor. */
|
||||
native set_user_armor(index,armor);
|
||||
|
||||
/* Sets player health. */
|
||||
native set_user_health(index, health);
|
||||
|
||||
/* Move player to origin. */
|
||||
native set_user_origin(index, origin[3]);
|
||||
|
||||
/* Sets player rendering mode. */
|
||||
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. */
|
||||
native give_item(index,const item[]);
|
||||
|
||||
/* 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_user_hitzones(index=0,target=0,body=255);
|
||||
|
||||
/* Returns hit zones for player. */
|
||||
native get_user_hitzones(index,target);
|
||||
|
||||
/* Makes that player spawns. This event is announced
|
||||
* with proper message to all players. */
|
||||
native user_spawn(index);
|
||||
|
||||
/* Sets users max. speed. */
|
||||
native set_user_maxspeed(index,Float:speed=-1.0);
|
||||
|
||||
/* Returns users max. speed. */
|
||||
native Float:get_user_maxspeed(index);
|
||||
|
||||
/* Sets users gravity. */
|
||||
native set_user_gravity(index,Float:gravity=1.0);
|
||||
|
||||
/* Returns users gravity. */
|
||||
native Float:get_user_gravity(index);
|
||||
|
||||
/* Gives money to user. */
|
||||
native set_user_money(index,money,flash=1);
|
||||
|
||||
/* Returns users money. */
|
||||
native get_user_money(index);
|
30
plugins/include/mysql.inc
Executable file
30
plugins/include/mysql.inc
Executable file
@ -0,0 +1,30 @@
|
||||
/* MySQL functions
|
||||
*
|
||||
* (c) Copyright 2002, dJeyL
|
||||
* 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. */
|
||||
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). */
|
||||
native mysql_query(sql,query[]);
|
||||
|
||||
/* Prepares next row of current query (sql) for read access ; returns the number of the row, 0 at end. */
|
||||
native mysql_nextrow(sql);
|
||||
|
||||
/* Stores specified column (fieldnum) of current query (sql) in (dest) with (maxlength) characters maximum. */
|
||||
native mysql_getfield(sql,fieldnum,dest[],maxlength);
|
||||
|
||||
/* Clears query (sql) and closes connection (if any other plugin doesn't use it). */
|
||||
native mysql_close(sql);
|
||||
|
||||
/* Stores last error of current query/connection (sql) in (dest) with (maxlength) characters maximum. */
|
||||
native mysql_error(sql,dest[],maxlength);
|
85
plugins/include/string.inc
Executable file
85
plugins/include/string.inc
Executable file
@ -0,0 +1,85 @@
|
||||
/* Strings manipulation
|
||||
*
|
||||
* (c) 2002-2003, 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. */
|
||||
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. */
|
||||
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. */
|
||||
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). */
|
||||
native format(output[] ,len ,const format[] , {Float,_}:...);
|
||||
|
||||
/* Gets parameters from function as formated string. */
|
||||
native format_args(output[] ,len ,pos = 0);
|
||||
|
||||
/* Converts number to string. */
|
||||
native num_to_str(num,string[],len);
|
||||
native numtostr(num,string[],len);
|
||||
|
||||
/* Returns converted string to number. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
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. */
|
||||
native parse(const text[], ... );
|
||||
|
||||
/* Converts all chars in string to lower case. */
|
||||
native strtolower(string[]);
|
||||
|
||||
/* Converts all chars in string to upper case. */
|
||||
native strtoupper(string[]);
|
||||
|
||||
/* Returns true when value is digit. */
|
||||
native isdigit(ch);
|
||||
|
||||
/* Returns true when value is letter. */
|
||||
native isalpha(ch);
|
||||
|
||||
/* Returns true when value is space. */
|
||||
native isspace(ch);
|
||||
|
||||
/* Returns true when value is letter or digit. */
|
||||
native isalnum(ch);
|
24
plugins/include/vault.inc
Executable file
24
plugins/include/vault.inc
Executable file
@ -0,0 +1,24 @@
|
||||
/* Vault
|
||||
*
|
||||
* (c) 2002-2003, 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. */
|
||||
native get_vaultdata(const key[], data[] = "", len = 0);
|
||||
|
||||
/* Sets a data under given key. */
|
||||
native set_vaultdata(const key[], const data[] = "" );
|
||||
|
||||
/* Removes a key from vault.*/
|
||||
native remove_vaultdata(const key[]);
|
||||
|
||||
/* Checks if a key exists in the vault.*/
|
||||
native vaultdata_exists(const key[]);
|
Reference in New Issue
Block a user