Raised This Month: $ Target: $400
 0% 

Stuck in wall detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 12-30-2005 , 18:48   Stuck in wall detection
Reply With Quote #1

Hi,

im looking for function that will safely detect when player is stucked in wall, floor or any solid object. I was considering obtaining player's position, pushing a client cmd +forward, and again obtaining position and compare them. But it always worth to ask here. Can u please help me?

Thnks in advance.
alien is offline
Send a message via ICQ to alien
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 12-30-2005 , 19:08  
Reply With Quote #2

This should work:

Code:
public posChange(id)     {     if ( !is_user_alive(id) )         return         get_user_origin(id, glastPosition[id])         new Float:velocity[3]     entity_get_vector(id, EV_VEC_velocity, velocity)         if ( velocity[0]==0.0 && velocity[1]==0.0 ) // make them jump         {         velocity[0] += 30.00         velocity[2] += 100.0         entity_set_vector(id, EV_VEC_velocity, velocity)     }         new origin[3]     get_user_origin(id, origin)         if ( glastPosition[id][0] == origin[0] && glastPosition[id][1] == origin[1] && glastPosition[id][2] == origin[2] && is_user_alive(id) )         {         // your code here (punishment for being stuck in wall)     } }

Adapted from Superhero Casper
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 12-30-2005 , 19:57  
Reply With Quote #3

Thank you. I'll try.
alien is offline
Send a message via ICQ to alien
Reply


Thread Tools
Display Modes

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 16:00.


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