AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to detect when a T is standing on a CT (https://forums.alliedmods.net/showthread.php?t=131010)

mottzi 06-30-2010 06:32

How to detect when a T is standing on a CT
 
Hello,

can somebody tell me, how to detect ( if......) when a Terrorist is standing on the head of a CT?

I have to do this in the takedamage event, so you can use iVictim(T) and IAttacker(CT)

I want do kill the CT when he shots on the T when the T is standing on his head. U understand?:wink:

Ryokin 06-30-2010 08:25

Re: How to detect when a T is standing on a CT
 
get origin both player and you hook the distance between t and ct origin[2]

minimiller 06-30-2010 09:10

Re: How to detect when a T is standing on a CT
 
you can use something like this
PHP Code:

new CsTeams:iTeamiStoodOn;

iTeam cs_get_user_team(id);
iStoodOn pev(idpev_groundentity);

if(
iStoodOn get_maxplayers)
{
    if(
iTeam != cs_get_user_team(iStoodOn))
    {
         
//id is stood on a player who is on the opposite team
    
}


untested


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

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