AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problems with touch detecting (https://forums.alliedmods.net/showthread.php?t=51955)

Bla^ 02-27-2007 10:13

Problems with touch detecting
 
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?

SAMURAI16 02-27-2007 10:30

Re: Problems with touch detecting
 
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
   
    }
}


Wilson [29th ID] 02-28-2007 13:23

Re: Problems with touch detecting
 
register_touch("player","player","func_hookto uch"); will be even better for that.

Greenberet 03-01-2007 04:26

Re: Problems with touch detecting
 
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))     {          //...     } }


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

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