4 posts,
3 people · 1,081 views
Thread Rating: ★★★★★
| closedregister_logevent |
| Started by Dr.G on 02-05-2009, 12:07 PM |
started this thread
Posts: 776Threads: 75
Joined: Nov 2007
02-05-2009, 12:07 PM
#1
Can someone tell my why this aint working to catch a flag cap? Or tell me another way to it. Ive tryed with Ham also but i cant only catch the touch, not the real trig...rnrnThanks in advance!rnrn
/* Plugin generated by AMXX-Studio */rnrn#include <amxmodx>rn#include <amxmisc>rnrn#define PLUGIN "Flag test"rn#define VERSION "1.0"rn#define AUTHOR "Dr.G"rnrn/*rnExsample from HLSWrn"Someones Name<406><STEAM_0:0:0000000><Axis>" triggered a "dod_capture_area" - "POINT_AVALANCHE_AXISGUNPOSITION"rn*/rnrnnew p_onrn////////////////////////////////////////////////////////////////////////////////////////////////////rn//rnpublic plugin_init() rn{rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn p_on = register_cvar("flag_test","1") // on / offrn rn register_logevent("flag_cap",3,"1=triggered a","2=dod_capture_area") rn rn rn //http://www.amxmodx.org/funcwiki.php?go=func&id=27rn //Bonus^^ http://forums.alliedmods.net/showthread.php?t=53137rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rn//rn// By teame06 really nice!rn// But what does it do???rn// This e.g (taken from log file!)rn/*rnrn"Dr.G<1><STEAM_0:0:1234567><Allies>" triggered a "dod_capture_area" - "POINT_ALLIEDSTREET"rnL 02/05/2009 - 15:38:13: [flag_test.amxx] 0 Dr.G<1><STEAM_0:0:1234567><Allies>rnL 02/05/2009 - 15:38:13: [flag_test.amxx] 1 triggered arnL 02/05/2009 - 15:38:13: [flag_test.amxx] 2 dod_capture_arearnL 02/05/2009 - 15:38:13: [flag_test.amxx] 3 -rnL 02/05/2009 - 15:38:13: [flag_test.amxx] 4 POINT_ALLIEDSTREETrnL 02/05/2009 - 15:38:22: [flag_test.amxx]rnrn*/rnpublic plugin_log() rn{rn new arg[256]rn read_logdata(arg, 255)rn log_amx("^n%s", arg)rn new args = read_logargc()rn for (new i = 0; i < args; ++i) rn {rn read_logargv(i, arg, 255)rn log_amx(" %d %s", i, arg)rn }rn}rnrn////////////////////////////////////////////////////////////////////////////////////////////////////rn//rnpublic flag_cap()rn{rn if (get_pcvar_num(p_on)) rn {rn new loguser[80], capers_name[64]rn read_logargv(0,loguser,79) //http://www.amxmodx.org/funcwiki.php?go=func&id=136 rn parse_loguser(loguser, capers_name, 63) //http://www.amxmodx.org/funcwiki.php?go=func&id=137rn rn new caperid = get_user_index(capers_name)rn rn client_print(caperid, print_chat, "hey %s u just capped a flag. cool?", capers_name)rn }rn return PLUGIN_CONTINUE; rn}posted here
Posts: 277Threads: 15
Joined: Mar 2007
02-05-2009, 04:55 PM
#2
Change the register log event to:nregister_logevent("flag_cap",5,"1=triggered a","2=dod_capture_area","2=dod_control_point")nnFor some reason it needs to pull the exact amount of arguments from the log, in this case 5 (0-4) or won't work and I added dod_control_point because some flags aren't triggered by a capture area but by actually walking over the flag.
started this thread
Posts: 776Threads: 75
Joined: Nov 2007
02-05-2009, 05:16 PM
#3
awesome! thank you!
posted here
Posts: 160Threads: 42
Joined: Sep 2007
03-02-2009, 03:41 PM
#4
hello,rnrndo you know how to check if capture of an flag is actually in process by an player ?

