Raised This Month: $ Target: $400
 0% 

player outside?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-12-2013 , 06:40   player outside?
Reply With Quote #1

is there an easy way to detect if a player it outside or inside of a building?
__________________
Blizzard_87 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-12-2013 , 06:47   Re: player outside?
Reply With Quote #2

Throwing a traceline and checking if you can hit sky ? I vaguely remember someone asking something similar, try to search.
__________________
Arkshine is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-12-2013 , 06:56   Re: player outside?
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Throwing a traceline and checking if you can hit sky ? I vaguely remember someone asking something similar, try to search.
ive tried searching but i must be using the wrong keywords since all the results show tracelines for aiming straight or users aiming, etc... cant find one they states JUST if player is outside...

EDIT: ok found this but doesnt explain anything in a way i understand http://forums.alliedmods.net/showthread.php?t=69817
__________________

Last edited by Blizzard_87; 07-12-2013 at 07:02.
Blizzard_87 is offline
bael
Junior Member
Join Date: Oct 2012
Old 07-12-2013 , 07:04   Re: player outside?
Reply With Quote #4

Search for auto weather plugin or something similar. I remember some of them had check if you are outside so there could be rain around you etc.
bael is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-12-2013 , 07:16   Re: player outside?
Reply With Quote #5

ok ive got this so far.. but its obviously wrong as its not working

Code:
public fwd_PlayerPreThink(id) {     if( !is_user_alive( id ) )         return FMRES_IGNORED;         if( pev(id, pev_flags) & FL_ONGROUND && is_user_outside(id) ) {         client_cmd( id, "speak ambience/rain.wav");     } else {         client_cmd( id, "speak NULL");     }     return FMRES_IGNORED; } stock Float:is_user_outside(id) {     new Float:vOrigin[3], Float:fDist;     pev(id, pev_origin, vOrigin);         fDist = vOrigin[2];         while(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_EMPTY)         vOrigin[2] += 5.0;         if(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_SKY)         return (vOrigin[2] - fDist);         return 0.0; }

EDIT: ok got it working to play sound but it executes the client_cmd like 1000X... which means the sound is all fuzzy instead of playing Once.
__________________

Last edited by Blizzard_87; 07-12-2013 at 07:24.
Blizzard_87 is offline
Reply



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 06:23.


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