Raised This Month: $ Target: $400
 0% 

Entity problems -- collision -- Part 2


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KaOs
Senior Member
Join Date: Apr 2004
Old 03-14-2005 , 16:15   Entity problems -- collision -- Part 2
Reply With Quote #1

OK, plugin is complete, only 1 problem..

My plugin is a port of AssKicR's "Admin Wall" plugin, but I wanted to add feature and fix things. The major problem with his plugin was collision, well, i've almost fixed that problem.

As of now, you place a wall and 2 seconds later it makes it solid (so you can't move through it) and it works fine, but only at 1 angle. It's like the hitbox for the entity doesn't know where the entity really is or something.. I don't know, here's the code:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new wallEnts[9999] new wallCount = 0 new g_theID new g_theWall public plugin_init() {     register_plugin("AMX Wall Maker", "1.11", "whitemike & AssKicR")     register_clcmd("amx_wall_create", "wallCreate", ADMIN_SLAY)     register_clcmd("amx_wall_clear", "wallClear", ADMIN_SLAY)     return PLUGIN_CONTINUE } public plugin_precache() {     precache_model("models/wall.mdl")     return PLUGIN_CONTINUE } public wallClear(id, level, cid) {     if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED     new i = 0     for(i=1; i<=wallCount; i++) {         remove_entity(wallEnts[i])         wallEnts[i] = false     }     client_print(id, print_chat, "[AMXX][WALL MAKER] %i Wall(s) removed.", i-1)     wallCount = 0     return PLUGIN_HANDLED } public wallCreate(id, level, cid) {     if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED     if (!is_user_alive(id)) {         client_print(id, print_chat, "[AMXX][WALL MAKER] Couldn't make wall! Reason: You are dead")         return PLUGIN_HANDLED     }     else {         if(g_theWall != 0) {             client_print(id, print_chat, "[AMXX][WALL MAKER] Couldn't make the wall! Reason: Too many in queue")             return PLUGIN_HANDLED         }         wallCount = wallCount + 1         new tmpWall         tmpWall = create_entity("info_target")         entity_set_string(tmpWall, EV_SZ_classname, "AMX_Wall_Placer")         entity_set_model(tmpWall, "models/wall.mdl")         //entity_set_float(tmpWall, EV_FL_health, 10000.0)         //entity_set_int(tmpWall, EV_INT_solid, 1)         new Float:MinBox[3]         new Float:MaxBox[3]         MinBox[0] = -10.0         MinBox[1] = -85.0         MinBox[2] = -125.0         MaxBox[0] = 10.0         MaxBox[1] = 85.0         MaxBox[2] = 125.0                 entity_set_vector(tmpWall, EV_VEC_mins, MinBox)         entity_set_vector(tmpWall, EV_VEC_maxs, MaxBox)         new Float:PlayerOrigin[3]         entity_get_vector(id, EV_VEC_origin, PlayerOrigin)         entity_set_origin(tmpWall, PlayerOrigin)         //entity_set_edict(tmpWall, EV_ENT_owner, id)         new Float:vRetVector[3]         entity_get_vector(id, EV_VEC_v_angle, vRetVector)         vRetVector[0]=float(0)         entity_set_vector(tmpWall, EV_VEC_angles, vRetVector)         client_print(id,print_chat,"[AMXX][WALL MAKER] Wall #%i has been created.", wallCount)         wallEnts[wallCount] = tmpWall         g_theID = id         g_theWall = wallCount         set_task(2.0, "wallCreate2")     }     return PLUGIN_HANDLED } public wallCreate2() {     new tmpWall = wallEnts[g_theWall]     client_print(g_theID,print_chat,"[AMXX][WALL MAKER] Wall #%i is now solid.", g_theWall)     entity_set_int(tmpWall, EV_INT_solid, 2)     entity_set_int(tmpWall, EV_INT_movetype, 4)     wallEnts[g_theWall] = tmpWall     g_theWall = 0     g_theID = 0 }
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
 



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 14:03.


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