AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TS - DeathMSG - No Weapon Returned? (https://forums.alliedmods.net/showthread.php?t=55990)

mysticssjgoku4 06-03-2007 21:59

TS - DeathMSG - No Weapon Returned?
 
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. :)

Arkshine 06-03-2007 22:12

Re: TS - DeathMSG - No Weapon Returned?
 
read_data(4) is a string.

http://wiki.alliedmods.net/Half-Life...vents#DeathMsg

mysticssjgoku4 06-03-2007 22:44

Re: TS - DeathMSG - No Weapon Returned?
 
Quote:

Originally Posted by arkshine (Post 485406)

So then..

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

Tried that already, and returns 0.

scrtxxcaz 06-03-2007 23:05

Re: TS - DeathMSG - No Weapon Returned?
 
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
}


Cheap_Suit 06-04-2007 23:52

Re: TS - DeathMSG - No Weapon Returned?
 
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
 
}



teame06 06-05-2007 03:27

Re: TS - DeathMSG - No Weapon Returned?
 
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.

Greenberet 06-05-2007 04:17

Re: TS - DeathMSG - No Weapon Returned?
 
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 ;)


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

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