AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   player is same team? [CS] (https://forums.alliedmods.net/showthread.php?t=49467)

trehmilou 01-04-2007 21:50

player is same team? [CS]
 
I want to show a small hudmessage "Don't shoot me :)" if the player I'm aiming at is in the same team as me. If the guy is enemy team, show nothing. How to do that?

XxAvalanchexX 01-04-2007 21:57

Re: player is same team? [CS]
 
Well, how much experience do you have?

In a nutshell, I'd hook traceline, use pentToSkip to identify the player who is aiming, and use get_tr and TR_pHit to identify the player being aimed at. Make sure both of the entities are really players. Then, compare teams, and display your hud message.

To optimize, you'll want to come up with a way to only display the hud message when necessary (when the hold time wears off), otherwise the client will get spammed and maybe overflow.


All times are GMT -4. The time now is 22:21.

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