AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Player in visible range (https://forums.alliedmods.net/showthread.php?t=295081)

gravi123 03-15-2017 18:09

Player in visible range
 
Is it possible to detect if a player is in visible range for each enemy (not behind a wall) when he shoots his gun?

OciXCrom 03-15-2017 18:54

Re: Player in visible range
 
https://www.amxmodx.org/api/engine/is_in_viewcone

gravi123 03-17-2017 16:38

Re: Player in visible range
 
Can someone explain to me a bit better how to use that :D

Bugsy 03-17-2017 19:42

Re: Player in visible range
 
Quote:

Originally Posted by gravi123 (Post 2504489)
Can someone explain to me a bit better how to use that :D

PHP Code:

new Float:fOrigin];
pevPlayer2ID pev_origin fOrigin );

if ( 
is_in_viewconePlayer1ID fOrigin ) )
{
     
//Player1ID can 'see' Player2ID


You can do a traceline to make sure nothing is in the way. There is a tutorial in the code snippets section.

Kotoamatsukami 03-18-2017 01:38

Re: Player in visible range
 
Quote:

Originally Posted by Bugsy (Post 2504513)
PHP Code:

new Float:fOrigin];
pevPlayer2ID pev_origin fOrigin );

if ( 
is_in_viewconePlayer1ID fOrigin ) )
{
     
//Player1ID can 'see' Player2ID


You can do a traceline to make sure nothing is in the way. There is a tutorial in the code snippets section.

Sorry, may I ask?
Does that involves all the 'INGNORE_MONSTERS' thingy?


All times are GMT -4. The time now is 18:04.

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