Raised This Month: $51 Target: $400
 12% 

Block Trap


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-05-2013 , 08:51   Block Trap
Reply With Quote #1

Hi all.
I need help with my code for blocking traps (like in deathrun)

Here's my code which doesn't work
PHP Code:
#include <amxmodx>
#include <hamsandwich>

new bool:g_bStopped[128];
// I don't know how much cells I need
// Tell if you know :D

new g_iMaxPlayers;

public 
plugin_init()
{
    
register_plugin("Block Trap""beta""didoWEE");
    
register_clcmd("say /test""StopFunc");
    
g_iMaxPlayers get_maxplayers();
    
RegisterHam(Ham_IsMoving"info_target""HookEntityMoving"0);
}

public 
StopFunc(id)
{
    new 
entbody;
    
get_user_aiming(identbody9999);

    if(
ent && ent g_iMaxPlayersg_bStopped[ent] = true;
}

public 
HookEntityMoving(ent)
{
    if(
g_bStopped[ent]) return HAM_SUPERCEDE;
    return 
HAM_IGNORED;


Last edited by didoWEE; 05-12-2013 at 08:10.
didoWEE is offline
Old 04-17-2013, 10:26
didoWEE
This message has been deleted by didoWEE.
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-19-2013 , 15:06   Re: Block Trap
Reply With Quote #2

bump
didoWEE is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-12-2013 , 08:08   Re: Block Trap
Reply With Quote #3

bump...
didoWEE is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-12-2013 , 08:16   Re: Block Trap
Reply With Quote #4

By default, entities indexes can be 1 - 1800, so your array is not big enough, but array doesn't seem a good way.

May be a Trie with models strings, since they should be unique starting with *


Why do you think info_target is the right classname ?
And why do you think IsMoving can help you for this ?


edit : Seems that IsMoving exists, but is never used by the game, so your plugin does nothing, and even if it was called, wouldn't block any movement.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-12-2013 at 08:20.
ConnorMcLeod is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-12-2013 , 13:46   Re: Block Trap
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
entities indexes can be 1 - 1800
This answers my comments in the code.Thanks

Quote:
Originally Posted by ConnorMcLeod View Post
Why do you think info_target is the right classname ?
I'll try with "*" and then I'll check the bool. Will it works?

Quote:
Originally Posted by ConnorMcLeod View Post
edit : Seems that IsMoving exists, but is never used by the game, so your plugin does nothing, and even if it was called, wouldn't block any movement.
Hmm... Will it work if I return HAM_SUPERCEDE in Prethink instead of IsMoving?

Last edited by didoWEE; 05-12-2013 at 13:46.
didoWEE is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-12-2013 , 14:54   Re: Block Trap
Reply With Quote #6

PreThink is a player function, what do you expect ?
Seriously, seems that you think about doing random stuff and expect it gonna make something.
Since you doesn't seem to understand anything on the game, you would have better to make a request, or to formulate your scripting help another way, asking for a method to do what you want.
Actually your code is not usable for anything.

What you should do, make an "investigation" plugin, like when you aim such a trap, it returns you (just thinking some plugins already exist) its classname, models and usefull stuff like target and/or targetname.

Then you can open .bsp file with notepad++ and search for that classname + target/targetname and other entities with same target/targetname.
Then, once you know what entity is trap and from which entity (button maybe) it is triggered, you can open HLSDK and see how those entities work and how you could change the way they work.

I hope i've helped you, because now you are at 10000km from what you want to do.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 06:07.


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