AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Who break my breakable ? (https://forums.alliedmods.net/showthread.php?t=51350)

solidsnake 02-16-2007 11:41

Who break my breakable ?
 
Dears friends,

I have a little trouble with func_breakable.

I'm able to set if a breakable is dead with register_think, but how to get the player that we destroy this breakable ?

i've tried : read_data, EV_ENT_dmg_inflictor,
EV_ENT_enemy,
EV_ENT_aiment

without sucess.

read_data 0 return a number but no always the good player :(
read_data 1 return always 1
read_data 2 the gun id
read_data 3 ??? i don't know but it's is not possible that is a player because this number is the same that another.

There is a solution with private read data ?

Thanks !

Davidos 02-16-2007 17:30

Re: Who break my breakable ?
 
Quote:

Originally Posted by solidsnake (Post 441136)
Dears friends,

I have a little trouble with func_breakable.

I'm able to set if a breakable is dead with register_think, but how to get the player that we destroy this breakable ?

i've tried : read_data, EV_ENT_dmg_inflictor,
EV_ENT_enemy,
EV_ENT_aiment

without sucess.

read_data 0 return a number but no always the good player :(
read_data 1 return always 1
read_data 2 the gun id
read_data 3 ??? i don't know but it's is not possible that is a player because this number is the same that another.

There is a solution with private read data ?

Thanks !


could it be that 0 is the first attacker and not the destroyer? Sorry I don't have knowledge of this...

Oskar 02-17-2007 08:22

Re: Who break my breakable ?
 
Maybe you coul'd check when players are shooting, and see if they are aiming at the breakable, and store the player id in a variable, so when the register_think detects that the breakable is destroyed, it will do whatever with the player id.

VEN 03-05-2007 04:53

Re: Who break my breakable ?
 
I believe that the Ham Sandwich module by sawce may help here.

EDIT: Module will not help for example if a player did throwed a grenade into the window.


All times are GMT -4. The time now is 00:42.

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