Raised This Month: $ Target: $400
 0% 

TS - DeathMSG - No Weapon Returned?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-03-2007 , 21:59   TS - DeathMSG - No Weapon Returned?
Reply With Quote #1

Today I was coding something for The Specialists, and I tried this:

Code:
register_event("DeathMsg","client_death","a") public client_death() {     new id = read_data(2)     new weapon = read_data(4)     client_print(id,print_chat,"Weapon: %d",weapon) }

It doesn't return anything but 0. :-\.
I'm wondering if this is a bug or...maybe I'm doing something wrong.

In any case I was hoping someone could verify this with me or help me find a way to get the same results.

This is the link to the DeathMSG event properties:
http://wiki.amxmodx.org/Half-Life_1_...vents#DeathMsg

Thanks again, appreciate the help.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-03-2007 , 22:12   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #2

read_data(4) is a string.

http://wiki.alliedmods.net/Half-Life...vents#DeathMsg
__________________
Arkshine is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-03-2007 , 22:44   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #3

Quote:
Originally Posted by arkshine View Post
So then..

Code:
new str[32] read_data(4,str,31)

Tried that already, and returns 0.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 06-03-2007 , 23:05   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #4

use this code in ur death msg event
Code:
new Weapon[32]
read_data(4,Weapon, sizeof Weapon - 1);
 if(equal(Weapon,"awp"))
{
     //do somin
}
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress

Last edited by scrtxxcaz; 06-10-2007 at 00:57.
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-04-2007 , 23:52   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #5

I believed that the users weapon gone on DeathMsg. But you can get their weapon on the Damage event.

PHP Code:
public plugin_init() 
{
 
register_event("Damage""event_damage""b""2>0")
}
public 
event_damage(id)
{
 if(
get_user_health(id) < 1)
 {
  
//save their weapon here
 
}

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 06-05-2007 , 03:27   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #6

http://forums.alliedmods.net/showthr...hlight=Message

Use this plugin. It will tell you the type and arguments. If it doesn't show up in here then it probably doesn't have it.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 06-05-2007 , 04:17   Re: TS - DeathMSG - No Weapon Returned?
Reply With Quote #7

some mods doesnt use the headshot in the DeathMsg ( like esf ) so the weapon is at position 3 and not 4.
and yeah do what teame06 says. this couldn't be wrong ;)
__________________
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode