Posted By: DLively
check the height of a block - 06/24/11 03:59
is it possible to approach a block, and see if its height (from my players height, to the top of the block) is under a certain number?
I have some theories.. but they dont work...
basically I have this to start >>
now since the block is not an entity, the 'you' pointer doesnt work..
so doing this:
gives me an empty pointer error
any ideas? .. Please
Edit: the reason why I would like this is because my player will check to see if the block infront of him is a valid block to jump up onto.. if its higher than 25, he shouldnt jump.. maybe this is some better info?
I have some theories.. but they dont work...
basically I have this to start >>
Code:
///.. Checked to see if the player is infront of a block if(trace_hit!=0){ if(you==null){//you are a wall jump_obstacle=1; } }
now since the block is not an entity, the 'you' pointer doesnt work..
so doing this:
Code:
///.. Checked to see if the player is infront of a block if(trace_hit!=0){ if(you==null){//you are a wall if(vec_dist(my.z, you.max_z)<25){jump_obstacle=1;} } }
gives me an empty pointer error
any ideas? .. Please
Edit: the reason why I would like this is because my player will check to see if the block infront of him is a valid block to jump up onto.. if its higher than 25, he shouldnt jump.. maybe this is some better info?