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

Solved Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by (-1)


Post New Thread Reply   
 
Thread Tools Display Modes
jackp
Member
Join Date: Jan 2016
Location: 
Old 01-18-2017 , 02:24   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #21

Are you testing takedamage on bots? Test it on Podbots/Realbots and see if it works.

Last edited by jackp; 01-18-2017 at 03:57. Reason: .
jackp is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-18-2017 , 08:10   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #22

@EFFx in some maps it works, but in surf_ski I shoot at the button and it doesn't open.
@jimmy thanks, didn't think of that.
@jackp you should've told me that yesterday ;) , yeah I was testing with bots, then I tested with PodBots and it worked ;)
__________________

Last edited by edon1337; 01-18-2017 at 08:10.
edon1337 is offline
jackp
Member
Join Date: Jan 2016
Location: 
Old 01-18-2017 , 14:23   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #23

Quote:
Originally Posted by edon1337 View Post
@EFFx in some maps it works, but in surf_ski I shoot at the button and it doesn't open.
@jimmy thanks, didn't think of that.
@jackp you should've told me that yesterday ;) , yeah I was testing with bots, then I tested with PodBots and it worked ;)
For some reason CS bot's cant hook ham forwards (at least takedamage, spawn, deaths, etc).

For the button, I tested on surf_sky_2 with noclip, and if you use E and press it, nothing will happen. Buttons with "touch activates" flag won't work.

Anyway there might be plugins like this so just search and maybe you will find it.

Last edited by jackp; 01-18-2017 at 14:47.
jackp is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-18-2017 , 14:45   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #24

It's because they don't have the "player" classname. You can still register hooks from them, by using RegisterHamFromEntity and providing a bot index(can be obtained from client_putinserver for example).

Quote:
5. Why in find_ent_by_x , "-1" is always as the index?
Because -1 is the invalid entity index. We start from that so we get all entities. If you start from x, all entities with a lower index will be ignored. That's why you see such code:
PHP Code:
new Target = -1
while((Target find_ent_by_class(Target, ...)) 
Basically, after it finds first ent, it will continue to search from that index so it does not return the same entity over and over again.

4. Don't use what EFFX gave you, the old file natives should not be used anymore. Check the tutorial for the new file system.
__________________

Last edited by HamletEagle; 01-18-2017 at 14:49.
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-18-2017 , 15:12   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #25

That was what I found. Anyway, you can (edon) search plugins that read .ini or .txt files. Like OciXCrom's plugins.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-18-2017 at 15:16.
EFFx is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-18-2017 , 16:55   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #26

@hamlet Yeah I figured out -1 is used because everytime ent is -1 in while loops. Thanks for explaining.
I found the way of how to save/retrieve , I kinda understand but, when do I Save/Retrieve data?

This is what I've done so far, but doesn't work.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new filename[256]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
get_configsdir(filename,255)
    
format(filename,255,"%s/filehandle.ini",filename)
}

public 
client_putinserver(id) {
    
    
LoadFlags(id)
}

public 
LoadFlags(id) {
    
    new 
filepointer fopen(filename,"r")
    
    if(
filepointer)
    {
        new 
readdata[128], steamid[32], password[18], flags[16], parsed_steamid[32], parsed_password[18], parsed_flags[16];
        
        while(
fgets(filepointer,readdata,127))
        {   
            
parse(readdataparsed_steamid31parsed_password,17parsed_flags15)
            
            
get_user_authid(id,steamid,31)
            
get_user_info(id,"setinfo _pw",password,17);
            
            if( 
equal(steamidparsed_steamid) && equal(passwordparsed_password) )
            {
                
flags[15] = str_to_num(parsed_flags)
                
client_print(id,print_chat,"Your Saved Steamid:%s Password : %s Flags : %s "parsed_steamidparsed_passwordstr_to_num(parsed_flags))
                break
            }
        }
        
fclose(filepointer)
    }

__________________

Last edited by edon1337; 01-18-2017 at 18:13.
edon1337 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 09:07.


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