The Dark Side
Former Staff Member
- Messages
- 1,004
- Reaction score
- 770
- Points
- 993
Anybody know one? Couldn't find anything in the GSC dumps.
Much love. Respect in the comments!
Much love. Respect in the comments!
Yep. What do you need specifically? DM me because I will be much more explicit about the answer; Not like cursing, moreso as detailed as possible.Anybody know one? Couldn't find anything in the GSC dumps.
Much love. Respect in the comments!
fDamageMoniter()
{
self endon("disconnect");
for(;;)
{
self waittill("damage", damage, attacker, direction_vec, point, type, modelname, tagname, partname, weaponname);
if(weaponname == "knife_mp")
{
if(type == "MOD_MELEE")
{
//Player has been knifed. use attacker as the person who delt the damage, self as the person who got damaged.
}
}
}
}
Dm'd.Yep. What do you need specifically? DM me because I will be much more explicit about the answer; Not like cursing, moreso as detailed as possible.
Tried messing with it for about 2 hours. Got nowhere. Thank you anyway! I hope it's not just me being stupid!Here is part of the detection from my Freezetag gametype. Hope it helps.
Code:fDamageMoniter() { self endon("disconnect"); for(;;) { self waittill("damage", damage, attacker, direction_vec, point, type, modelname, tagname, partname, weaponname); if(weaponname == "knife_mp") { if(type == "MOD_MELEE") { //Player has been knifed. use attacker as the person who delt the damage, self as the person who got damaged. } } } }
What do you need it to check for? I would be happy to modify it for you.Dm'd.
Tried messing with it for about 2 hours. Got nowhere. Thank you anyway! I hope it's not just me being stupid!
That's awesome to hear! How did you solve the problem? Would be cool if you share your solution to the people who are also struggling with it!Forgot to reply here. Thread can be closed. Issue is solved.
SeriousHD- and zerker24 helped me out, but in the end, zerker solved it for me. On top of that, the way of detecting a player getting hit with your gun was a challenge for me. It made me feel pretty stupid considering I couldn't figure it out. Bottom line, there is no check for damaging a player. You have to define it yourself. Like this.That's awesome to hear! How did you solve the problem? Would be cool if you share your solution to the people who are also struggling with it!
Playerdamagecheck()
{
self endon("disconnect");
level endon("TURTLESTOP");
for(;;)
{
self waittill("damage", damage, attacker, direction_vec, point, type, modelname, tagname, partname, weaponname);
if(weaponname == "kard_wager_mp+reflex+silencer" && attacker.turtlegunactive)
{
attacker playerturtle(self);
self.health = self.maxhealth;
wait 0.5;
}
}
}
That's awesome to hear! How did you solve the problem? Would be cool if you share your solution to the people who are also struggling with it!
Happy I could help! Also, this method is pretty simple lol and I am not sure there is any other way. Well, any other simple way. I suppose you could use button presses and player health checks, but that would be REALLY inefficient and ugly in my opinion.SeriousHD- and zerker24 helped me out, but in the end, zerker solved it for me. On top of that, the way of detecting a player getting hit with your gun was a challenge for me. It made me feel pretty stupid considering I couldn't figure it out. Bottom line, there is no check for damaging a player. You have to define it yourself. Like this.
There may be an easier more simple way of coding this. But this works.Code:Playerdamagecheck() { self endon("disconnect"); level endon("TURTLESTOP"); for(;;) { self waittill("damage", damage, attacker, direction_vec, point, type, modelname, tagname, partname, weaponname); if(weaponname == "kard_wager_mp+reflex+silencer" && attacker.turtlegunactive) { attacker playerturtle(self); self.health = self.maxhealth; wait 0.5; } } }
After you got it done, i thought why couldnt you just do something like this? No need for a check in this way. But i tried it and it didnt work.Happy I could help! Also, this method is pretty simple lol and I am not sure there is any other way. Well, any other simple way. I suppose you could use button presses and player health checks, but that would be REALLY inefficient and ugly in my opinion.
if( self getcurrentweapon() == "kard_wager_mp+reflex+silencer" )
{
tracebull = bullettrace( self gettagorigin( "j_head" ), self gettagorigin( "j_head" ) + anglestoforward( self getplayerangles() ) * 1000000, 1, self );
}
tracebull[ "entity"] thread playerturtle();