7 posts,
3 people · 827 views
Thread Rating: ★★★★★
| closedDetecting weapons |
| Started by =|[76AD]|= TatsuSaisei on 12-29-2006, 07:39 AM |
started this thread
Posts: 794Threads: 54
Joined: May 2005
12-29-2006, 07:39 AM
#1
npublic plugin_init()n{n register_plugin(PLUGIN, VERSION, AUTHOR)n register_event("CurWeapon", "check_weapon","be")n}n npublic check_weapon(id)n{n new clip, ammo, myWeapon = dod_get_user_weapon(id,clip,ammo)n new gunName[32],gunNam[32]n xmod_get_wpnlogname( myWeapon, gunName, 32) n xmod_get_wpnname ( myWeapon, gunNam, 32 ) n client_print(id,print_chat,"Detected Weapon (%s)(%s) Clip (%d) Ammo (%d)",gunName,gunNam, clip, ammo)n}nn nHow come when I do this I get strange returns on some weapons ?? Suggestions ?? n nI started out trying to find a way to detect when a player was holding the Scoped Enfield...posted here
Posts: 688Threads: 75
Joined: Jun 2006
12-29-2006, 09:37 AM
#2
|= TatsuSaisei;3039']nnWell first off...you have declared gunName twice this wont work. Try the following:nnnHow come when I do this I get strange returns on some weapons ?? Suggestions ?? n nI started out trying to find a way to detect when a player was holding the Scoped Enfield...npublic plugin_init()n{n register_plugin(PLUGIN, VERSION, AUTHOR)n register_event("CurWeapon", "check_weapon","be")n}n npublic check_weapon(id)n{n new clip, ammo, myWeapon = dod_get_user_weapon(id,clip,ammo)n new gunName[32],gunNam[32]n xmod_get_wpnlogname( myWeapon, gunName, 32) n xmod_get_wpnname ( myWeapon, gunNam, 32 ) n client_print(id,print_chat,"Detected Weapon (%s)(%s) Clip (%d) Ammo (%d)",gunName,gunNam, clip, ammo)n}n
npublic plugin_init()n{n register_plugin(PLUGIN, VERSION, AUTHOR)n register_event("CurWeapon", "check_weapon","be")n}n npublic check_weapon(id)n{n new clip, ammo, myWeapon = dod_get_user_weapon(id,clip,ammo)n new logName[32],gunNam[32]n xmod_get_wpnlogname( myWeapon, logName, 32) n xmod_get_wpnname ( myWeapon, gunNam, 32 ) n client_print(id,print_chat,"Detected Weapon (%d)(%s)(%s) Clip (%d) Ammo (%d)", myWeapon, logName, gunNam, clip, ammo)n}nstarted this thread
Posts: 794Threads: 54
Joined: May 2005
12-29-2006, 09:59 AM
#3
Well first off...you have declared gunName twice this wont workn nactually if you look closer they are slightly different.. gunName and gunNam (missing an e) ... try the code and see what you think of what it reports...
started this thread
Posts: 794Threads: 54
Joined: May 2005
12-29-2006, 10:41 AM
#4
ok Zor, you NEED to know this... the code works perfect when I run the "official" dodx (1.76c), the issues I had come from using your dodx.dll !! I put back the "official" dodx and everything is reported properly...
posted here
Posts: 688Threads: 75
Joined: Jun 2006
12-29-2006, 01:05 PM
#5
Ok Im looking into it now...nnCheers!
posted here
Posts: 688Threads: 75
Joined: Jun 2006
12-29-2006, 02:36 PM
#6
|= TatsuSaisei;3049']ok Zor, you NEED to know this... the code works perfect when I run the "official" dodx (1.76c), the issues I had come from using your dodx.dll !! I put back the "official" dodx and everything is reported properly...nnOk this error has been fixed...I love it now that I know how to attach to a process and do real time debugging on the server and client as it plays!nnCheers!
posted here
Posts: 2,068Threads: 103
Joined: May 2005
12-29-2006, 10:33 PM
#7
great zor is breaking everything!!nn:-P

