Raised This Month: $51 Target: $400
 12% 

Distance kill


Post New Thread Reply   
 
Thread Tools Display Modes
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-05-2016 , 11:34   Re: Distance kill
Reply With Quote #11

There's is no need to check if the attacker is connected because he's not doing anything to the attacker. He's simply showing a chat message to everyone not just to the attacker.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 02-05-2016 at 11:40.
wickedd is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-05-2016 , 13:32   Re: Distance kill
Reply With Quote #12

wickedd

Quote:
RegisterHam(Ham_Killed, "player", "onPlayerKilled", 1);
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-05-2016 , 13:53   Re: Distance kill
Reply With Quote #13

Quote:
Originally Posted by Hedgehog95 View Post
wickedd

RegisterHam(Ham_Killed, "player", "onPlayerKilled", 1);
And your point is?

P.S. If you remove those checks it will still display the message. Test it and see for yourself.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 02-05-2016 at 13:55.
wickedd is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-05-2016 , 16:58   Re: Distance kill
Reply With Quote #14

wickedd,
Are you kidding me?
Dude, killer index can be 0, killer can disconnect after the killing, killer index can be equal to victim index if victim kill yourself.

PHP Code:
new killerOrigin[3];
get_user_origin(killerkillerOrigin); 
PHP Code:
new killerName[32];
get_user_name(killerkillerNamecharsmax(killerName)); 
PHP Code:
new weapon get_user_weapon(killer); 
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 02-05-2016 at 17:02.
Hedgehog Fog is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2016 , 18:52   Re: Distance kill
Reply With Quote #15

You should probably check if killer is connected. He could toss a grenade then disconnect in the meantime his grenade kills someone. DeathMsg fires and tries to get origin and name of a disconnected slot.
__________________
Bugsy is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 02-05-2016 , 19:14   Re: Distance kill
Reply With Quote #16

You can try this Hud message + chat message : https://forums.alliedmods.net/showthread.php?p=825597
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-05-2016 , 19:24   Re: Distance kill
Reply With Quote #17

That's true Bugsy but he checked if the weapon != knife, so anything after that will not be called. The reason I said is_user_connected is needless in this case is because he's not doing anything to the attacker. I may be wrong but I don't see any need to check in this particular situation. Now if he wouldn't have checked for the weapon then I would agree.

P.S. If missed something please let me know.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2016 , 20:31   Re: Distance kill
Reply With Quote #18

Quote:
Originally Posted by wickedd View Post
That's true Bugsy but he checked if the weapon != knife, so anything after that will not be called. The reason I said is_user_connected is needless in this case is because he's not doing anything to the attacker. I may be wrong but I don't see any need to check in this particular situation. Now if he wouldn't have checked for the weapon then I would agree.

P.S. If missed something please let me know.
Ah, didn't see the knife condition. It should be fine then.
__________________
Bugsy is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 02-05-2016 , 21:11   Re: Distance kill
Reply With Quote #19

A player can be kicked from the server after the kill.


Quote:
Originally Posted by akefis View Post
When I kill anyone body to body plugin tell : zyclon killed AKEFIS at 1055.999999 meters
Can someone explain this to me?
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 02-05-2016 at 21:55.
Hedgehog Fog is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2016 , 21:22   Re: Distance kill
Reply With Quote #20

Yes, but this only fires on knife kill. There's no way for him to disconnect between when the kill happens and DeathMsg shows since it's instant. The only issue is with grenades.

We are talking about two codes here. My comments refer to wickeds.

Your code hedgehog needs the is user connected check for killer. You don't need it on victim though.
__________________

Last edited by Bugsy; 02-05-2016 at 21:32.
Bugsy is offline
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:44.


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