搜索
查看: 4690|回复: 7

飘风帮忙啊,我该用哪个函数啊?

[复制链接]
发表于 2004-4-16 12:45:05 | 显示全部楼层 |阅读模式 来自 中国–陕西–西安–长安区
如果我要读取我所杀死的人的数据,该用哪个函数啊?是get_user_vstats()吗?是的话,请给我解释一下参数,要是不是的话我该用哪个函数啊? :cry2:
发表于 2004-5-17 11:20:38 | 显示全部楼层 来自 中国–北京–北京
native get_user_deaths(index);
这是其他的函数
forward plugin_init();
Function is called just after server activation.
Good place for configuration loading, commands and cvars registration.  

forward plugin_end();
Function called before plugin unloading (server deactivation)  

forward plugin_log();
Called on log message.  

forward plugin_precache();
Use here model_precache() and sound_precache() functions.  

forward client_infochanged(id);
Whenever player info is changed, this function is called.  

forward client_connect(id);
Called on client connection.  

forward client_disconnect(id);
Called when client is disconnecting from server.  

forward client_command(id);
Called when client is sending command.  

forward client_putinserver(id);
Called when client is entering to the game.  

native register_plugin(const plugin_name[],const version[],const author[]);
Sets informations about plugin.  

native get_plugin(index,filename[],len1,name[],len2,version[],len3,author[],len4,status[],len5);
Gets info about plugin by given index.
Function returns -1 if plugin doesn't exist with given index.  

native get_pluginsnum();
Returns number of all loaded plugins.  

native precache_model(const name[]);
Precache model. Can be used only in plugin_precache() function.

native precache_sound(const name[]);
Precache sound. Can be used only in plugin_precache() function.

native set_user_info(index,const info[],const value[]);
Sets info for player.  

native get_user_info(index,const info[],output[],len);
Gets info from player.  

native set_localinfo(const info[],const value[]);
Sets info for server.  

native get_localinfo(const info[],output[],len);
Gets info from server.  

native show_motd(player,const message[],const header[]="");
Shows text in MOTD window. When there is no header, the MOTD title
will be the name of server. If message is filename, then the contents
of this file will be displayed as MOTD.  

native client_print(index,type,const message[],{Float,_}:...);
Sends message to player. Set index to 0 to send text globaly.  

native engclient_print(player,type,const message[],{Float,_}:...);
Sends message to player by engine. Set index to 0 to send text globaly.  

native console_print(id,const message[],{Float,_}:...);
Sends message to console.  

native console_cmd(id,const cmd[],{Float,_}:...);
Sends command to console.  

native register_event(const event[],const function[],const flags[],cond[]="", ... );
Registers event on which the 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_logevent(const function[], argsnum, ... );
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 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);
Sets format for hudmessage.  

native show_hudmessage(index,const message[],{Float,_}:...);
Displays HUD message to given player.  

native show_menu(index,keys,const menu[], time = -1);
Displays menu. Keys have bit values (key 1 is (1<<0), key 5 is (1<<4) etc.).  

native read_data(value, {Float,_}:... );
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_logdata(output[],len);
Gets log message. Can be called only in plugin_log() forward function.  

native read_logargc();
Returns number of log arguments.
Can be called only in plugin_log() forward function.  

native read_logargv(id,output[],len);
Gets log argument indexed from 0.
Can be called only in plugin_log() forward function.  

native parse_loguser(const text[], name[], nlen, &userid = -2, authid[] = "", alen = 0, team[]="", tlen=0);
Parse log data about user ( "Butcher<5>" etc. ).  

native server_print(const message[], {Float,_}:...);
Prints message to server console.
You may use text formating (f.e. server_print("%-32s %.2f!","hello",7.345))  

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();
Returns 1 or 0.  

native get_user_attacker(index,...);
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 Float:get_user_aiming(index,&id,&body,dist=9999);
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 get_user_frags(index);
Returns player frags.  

native get_user_deaths(index);
Returns player deaths.  

native get_user_armor(index);
Returns player armor.  

native get_user_health(index);
Returns player health.  

native get_user_index(const name[]);
Returns index.  

native get_user_ip(index,ip[],len, without_port = 0);
Returns ip.  

native get_user_weapon(index,&clip,&ammo);
Returns id of currently carried weapon. Gets also
ammount of ammo in clip and backpack.  

native get_user_ammo(index,weapon,&clip,&ammo);
Gets ammo and clip from current weapon.  

native num_to_word(num,output[],len);
Converts numbers from range 0 - 999 to words.  

native get_user_team(index, team[]="", len = 0);
Returns team id. When length is greater then 0
then the name of team is set.  

native get_user_time(index, flag = 0);
Returns player playing time in seconds.
If flag is set then result is without connection time.  

native get_user_ping(index, &ping, &loss);
Gets ping and loss at current time.  

native get_user_origin(index, origin[3], mode = 0);
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_weapons(index,weapons[32],&num);
Returns all carried weapons as bit sum. Gets
also theirs indexes.  

native get_weaponname(id,weapon[],len);
Returns weapon name.  

native get_user_name(index,name[],len);
Returns player name.  

native get_user_authid(index, authid[] ,len);
Gets player authid.  

native get_user_wonid(index);
Returns player wonid.  

native get_user_userid(index);
Returns player userid.  

native user_slap(index,power,rnddir=1);
Slaps player with given power.

native user_kill(index,flag=0);
Kills player. When flag is set to 1 then death won't decrase frags.  

native log_message(const message[],{Float,_}:...);
Sends message to standard HL logs.  

native log_to_file(const file[],const message[],{Float,_}:...);
Sends log message to specified file.  

native get_playersnum(flag=0);
Returns number of players put in server.
If flag is set then also connecting are counted.  

native get_players(players[32], &num ,const flags[]="", const team[]="");
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 read_argv(id,output[],len);
Gets argument from command.  

native read_args(output[],len);
Gets line of all arguments.  

native read_argc();
Returns number of arguments (+ one as command).  

native read_flags(const flags[]);
Converts string to sum of bits.
Example: "abcd" is a sum of 1, 2, 4 and 8.  

native get_flags(flags,output[],len);
Converts sum of bits to string.
Example: 3 will return "ab".  

native find_player(const flags[], ... );
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 remove_quotes(text[]);
Removes quotes from sentence.  

native client_cmd(index,const command[],{Float,_}:...);
Executes command on player.  

native engclient_cmd(index,const command[],arg1[]="",arg2[]="");
This is an emulation of client command (command isn't send to client!).
It allows to execute some commands on players and bots.
Function is excellent for forcing to do action related to game (not settings!).
The command must stand alone but in arguments you can use spaces.  

native server_cmd(const command[],{Float,_}:...);
Executes command on server console.  

native set_cvar_string(const cvar[],const value[]);
Sets cvar to given value.  

native cvar_exists(const cvar[]);
If cvar exists returns 1, in other case 0  

native remove_cvar_flags(const cvar[],flags = -1);
Removes cvar flags (not allowed for amx_version,
fun_version and sv_cheats cvars).  

native set_cvar_flags(const cvar[],flags);
Sets cvar flags (not allowed for amx_version,
fun_version and sv_cheats cvars).  

native get_cvar_flags(const cvar[]);
Returns cvar flags.  

native set_cvar_float(const cvar[],Float:value);
Sets cvar to given float.  

native Float:get_cvar_float(const cvarname[]);
Gets cvar float.  

native get_cvar_num(const cvarname[]);
Gets cvar integer value.  

native set_cvar_num(const cvarname[],value);
Sets cvar with integer value.  

native get_cvar_string(const cvarname[],output[],iLen);
Reads cvar value.  

native get_mapname(name[],len);
Returns name of currently played map.  

native get_timeleft();
Returns time remaining on map in seconds.  

native Float:get_gametime();
Returns game time.  

native get_maxplayers();
Returns maxplayers setting.  

native get_modname(name[],len);
Returns name of currently played mod.  

native get_time(const format[],output[],len);
Returns time in given format. The most popular is: "%m/%d/%Y - %H:%M:%S".  

native set_task(Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0);
Calls function on specified time.
Flags:
"a" - repeat.
"b" - loop task.

native remove_task(id, outside=0);
Removes task. If outside var is set then the task can be
removed also when was set in another plugin.  

native set_user_flags(index,flags=-1,id=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 get_user_flags(index,id=0);
Gets flags from player. Set index to 0 if you want to read flags from server.  

native remove_user_flags(index,flags=-1,id=0);
Removes flags for player.  

native register_clcmd(const client_cmd[],const function[],flags=-1, info[]="");
Registers function which will be called from client console.  

native register_concmd(const cmd[],const function[],flags=-1, info[]="");
Registers function which will be called from any console.  

native register_srvcmd(const server_cmd[],const function[],flags=-1, info[]="");
Registers function which will be called from server console.  

native get_clcmd(index, command[], len1, &flags, info[], len2, flag);
Gets info about client command.  

native get_clcmdsnum(flag);
Returns number of registered client commands.  

native get_srvcmd(index,server_cmd[],len1,&flags, info[],len2, flag);
Gets info about server command.  

native get_srvcmdsnum(flag);
Returns number of registered server commands.  

native get_concmd(index,cmd[],len1,&flags, info[],len2, flag, id = -1);
Gets info about console command. If id is set to 0,

native get_concmdsnum(flag,id = -1);
Returns number of registered console commands.  

native register_menuid(const menu[]);
Gets unique id of menu.  

native register_menucmd(menuid,keys,const function[]);
Calls function when player uses specified menu and proper keys.  

native get_user_menu(index,&id,&keys);
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 server_exec();
Forces server to execute sent server command at current time.
Very useful for map changes, setting cvars and other activities.  

native emit_sound(index, channel, sample[], Float:vol, Float:att,flags, pitch);
Emits sound. Sample must be precached.  

native get_distance(origin1[3],origin2[3]);
Returns distance between two vectors.  

native register_cvar(const name[],const string[],flags = 0,Float:fvalue = 0.0);
Registers new cvar for HL engine.  

native Float:random_float(Float:a,Float:b);
Generates random floating point number from a to b.  

native random_num(a,b);
Generates random integer from a to b.  

native pause(flag[], const param1[]="",const param2[]="");
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).
Example: pause("ac","myplugin.amx")
pause("bc","myfunc","myplugin.amx")  

native unpause(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 get_user_msgid(const name[]);
Returns id of client message.
Example: get_user_msgid("TextMsg").
native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
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_end();
No description available

native write_byte( x );
No description available

native write_char( x );
No description available

native write_short( x );
No description available

native write_long( x );
No description available

native write_entity( x );
No description available

native write_angle( x );
No description available

native write_coord( x );
No description available

native write_string( x[] );
No description available

forward inconsistent_file(id,const filename[], reason[256] );
Called on inconsistent file.  

native force_unmodified(force_type, mins[3] , maxs[3], const filename[]);
Forces the client and server to be running with the same
version of the specified file ( e.g., a player model ).
回复

使用道具 举报

发表于 2004-5-23 00:47:33 | 显示全部楼层 来自 中国–广东–广州–海珠区
楼上的兄弟的资料好像很有用的哦,是从哪来的?
回复

使用道具 举报

发表于 2004-6-11 00:17:39 | 显示全部楼层 来自 中国–云南–昆明
Post by DreamZSW
楼上的兄弟的资料好像很有用的哦,是从哪来的?

这里都是,不过不懂啊

http://amxmod.net/amx-natives.php
回复

使用道具 举报

发表于 2004-6-22 06:57:45 | 显示全部楼层 来自 中国–黑龙江–佳木斯
难道大家都不看 addons\amxx\scripting\include 里面的文件吗?
比如 amxmodx.inc  amxconst.inc ...

我可以说是受益匪浅呀
回复

使用道具 举报

 楼主| 发表于 2004-6-22 10:37:12 | 显示全部楼层 来自 中国–陕西–西安
Post by 多年菜鸟
难道大家都不看 addons\amxx\scripting\include 里面的文件吗?
比如 amxmodx.inc  amxconst.inc ...

我可以说是受益匪浅呀

呵呵,已经顶礼膜拜了,一有不会的就去查阅
回复

使用道具 举报

发表于 2004-6-22 12:33:24 | 显示全部楼层 来自 中国–云南–昆明
~~看过~看不懂~教教我吧
回复

使用道具 举报

发表于 2010-7-11 14:54:44 | 显示全部楼层 来自 中国–内蒙古–鄂尔多斯
server_print(const message[], any:...)中
const message[], any:...  是干什么的啊 怎么表示呢?
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表