Raised This Month: $ Target: $400
 0% 

BlockMaker All Sides


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BigMac
Member
Join Date: Jul 2009
Old 07-31-2009 , 21:11   BlockMaker All Sides
Reply With Quote #1

Hi, was trying to make it so my blockmaker is not just ontop only, i want to make it so that ALL the sides of the block work. Could anyone help me out with this? I've tried

Here is a part of the code i think i have to add to

//trace directly down to see if there is a block beneath player
new Float:pOrigin[3];
new Float:pSize[3];
new Float:pMaxs[3];
new Float:vTrace[3];
new Float:vReturn[3];
entity_get_vector(id, EV_VEC_origin, pOrigin);
entity_get_vector(id, EV_VEC_size, pSize);
entity_get_vector(id, EV_VEC_maxs, pMaxs);

//calculate position of players feet
pOrigin[2] = pOrigin[2] - ((pSize[2] - 36.0) - (pMaxs[2] - 36.0));

//make the trace small for some blocks
vTrace[2] = pOrigin[2] - 1.0;

//do 4 traces for each corner of the player
for (new i = 0; i < 4; ++i)
{
switch (i)
{
case 0: { vTrace[0] = pOrigin[0] - 16; vTrace[1] = pOrigin[1] + 16; }
case 1: { vTrace[0] = pOrigin[0] + 16; vTrace[1] = pOrigin[1] + 16; }
case 2: { vTrace[0] = pOrigin[0] + 16; vTrace[1] = pOrigin[1] - 16; }
case 3: { vTrace[0] = pOrigin[0] - 16; vTrace[1] = pOrigin[1] - 16; }
}

ent = trace_line(id, pOrigin, vTrace, vReturn);

//if entity found is a block
if (isBlock(ent))
{

Thank You
__________________
BigMac is offline
 



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 18:21.


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