Raised This Month: $ Target: $400
 0% 

Problems with touch detecting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bla^
New Member
Join Date: Feb 2007
Old 02-27-2007 , 10:13   Problems with touch detecting
Reply With Quote #1

Hi!

I´m working with one plugin but now i have a problem. How i can check if Ct is touching Terrorist. Maybe somehow with entities?
Bla^ is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-27-2007 , 10:30   Re: Problems with touch detecting
Reply With Quote #2

somethig like that:
Code:
#include <amxmodx>
#include <cstrike>
#include <engine>


public plugin_init() {
    register_touch("ent","player","for_touch");
}

public for_touch(toucher,touched)
{
    new CsTeams:touc = cs_get_user_team(toucher)
    new CsTeams:toucd = cs_get_user_team(touched)
    
    if( (touc == CS_TEAM_CT) && (toucd == CS_TEAM_T))
    {
        // bla bla
    
    }
}
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 02-28-2007 , 13:23   Re: Problems with touch detecting
Reply With Quote #3

register_touch("player","player","func_hookto uch"); will be even better for that.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 03-01-2007 , 04:26   Re: Problems with touch detecting
Reply With Quote #4

Code:
#include <amxmodx> #include <cstrike> #include <engine> public plugin_init() {     register_touch("player","player","hook_touch"); } public hook_touch(toucher,touched) {     if(cs_get_user_team(toucher) != cs_get_user_team(touched))     {          //...     } }
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply


Thread Tools
Display Modes

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 00:40.


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