AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fatal touch (https://forums.alliedmods.net/showthread.php?t=17672)

alien 09-06-2005 10:46

Fatal touch
 
Hi pips.

I'm almost done with my plugin, thanks to you too. ;) Only think that's not completed is fatal touch. I need a function that detects touch of two players and kills touched. Toucher should be teleported to touched's position, but it's not important. Any idea??

Thnx.

v3x 09-06-2005 12:18

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_touch("player","player","on_touch"); } public on_touch(ptr,ptd) {     if(ptr > 0 && ptr <= 32 && is_user_connected(ptr))     {         if(ptd > 0 && ptd <= 32 && is_user_connected(ptd))         {             // zomg a touch!         }     } }
Or something..

LynX 09-06-2005 12:48

Code:
user_kill(ptd)

Put there were he is touched.

alien 09-06-2005 14:05

Man, great forum, thank you for your replies. I always get an answer here in notime. :wink:

XxAvalanchexX 09-06-2005 15:52

v3x, why the hell do you do checks to ensure that it's a player since your register_touch is only called when two players touch each other anyway? Also, this may kill both players at the same time.

v3x 09-06-2005 17:09

lawl, I dunno.. Ignore me for now as I go to bed, or pass out at my pc..

alien 09-07-2005 20:37

Is it possible to detect touch of two players where one is SOLID_NOT? Are there other solid state settings to do this? I replaced SOLID_NOT with SOLID_TRIGGER, but server crashes when 2 players collide. :(

alien 09-07-2005 23:54

I should tell you more: Im modifying ClimbTimer plugin for our jump server. It's importat for each player not to block other players. But some of them do it. If there is blocker and blocked, I want blocker to get killed immediately after collision with blocked and get blocked teleported to blocker's position. But it's not working until both blocker and blocked have SOLID_SLIDEBOX and that means, both of them are blockers.


All times are GMT -4. The time now is 14:33.

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