BlockMaker All Sides
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 :) |
Re: BlockMaker All Sides
Remove the checking part of if the block is underneath the player and move the code after the checking to a callback for register_touch(blockclassname, "player", "callback")
|
Re: BlockMaker All Sides
"Remove the checking part of if the block is underneath the player"
Did that and it works "move the code after the checking to a callback for" No idea where to move the code or even what part of the code to move so it checks for public fwdTouch "register_touch(gszBlockClassname, "player", "callback")" Did that works I was looking at the BCM code but thats totally different he uses public fwdTouch Could you or anyone who knows show me an example of one block and i'll take it form there. Or help me out by explaining it a bit more Thank You :) |
| All times are GMT -4. The time now is 18:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.