Raised This Month: $ Target: $400
 0% 

[SOLVED] Ham Touch doesn't work on POD BOT-s :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-12-2009 , 14:22   [SOLVED] Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #1

I have such a code:
PHP Code:
public plugin_init()  
    
RegisterHam(Ham_Touch,"weapon_c4","fw_TakeBomb")

public 
fw_TakeBomb(weapon_ent,id)
{

    if(
g_BombStatus == BOMB_NOT)
    {
        
g_BombCarrier id
        g_BombStatus 
BOMB_PICKEDUP

        server_print
("%i is New Carrier",id)
    }

    else if(
g_NewRoundRespawn)
    {
        
server_print("BOMB is TRANSFERED TO %i",id)
        
        
SetHamParamEntity(2,g_BombCarrier)

        return 
HAM_HANDLED;
    }

            
    return 
HAM_IGNORED;

With Humans it works perfectly.. But with POD bots
It does't change param here:
PHP Code:
        SetHamParamEntity(2,g_BombCarrier)

        return 
HAM_HANDLED

Any Suggestions?

Last edited by Empowers; 04-13-2009 at 09:39.
Empowers is offline
Send a message via ICQ to Empowers
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-12-2009 , 14:26   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #2

I can't remember if it is all or some, but some Ham_* don't work with bots.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-12-2009 , 14:29   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #3

Strange There are many Ham hooks in zombie-plague or in gungame.. But POD BOTs work perfectly with this mods.

And also touch hook gets executed always on POD bot-s.. I can see messages in server console, but no result when changing param.

Why?

Last edited by Empowers; 04-12-2009 at 14:31.
Empowers is offline
Send a message via ICQ to Empowers
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-12-2009 , 15:11   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #4

Edit2: Oops sorry, I didn't see you say it works perfect for humans.
__________________

Last edited by Bugsy; 04-12-2009 at 15:21.
Bugsy is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-12-2009 , 15:21   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #5

Quote:
I'm 99.9% sure it is a weaponbox while on the ground
No I wanna to hook when c4 is gived by engine,
but not pickuped from the groud..

Here how engine does it:
Code:
Ham_Spawn (weapon_c4, info_player_deathmatch)
Ham_Touch (weapon_c4, player)

Last edited by Empowers; 04-12-2009 at 15:39.
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-12-2009 , 16:26   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #6

The following code works fine with PodBots, means that the problem is somewhere in your code, you may try to supercede the forward and fire another touch.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Detect c4"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_iMaxPlayers get_maxplayers()
    
RegisterHam(Ham_Touch"weapon_c4""C4_Touch")
}

public 
C4_Touch(iEntid)
{
    if( 
IsPlayer(id) )
    {
        
client_print(0print_chat"C4 touched by %d"id)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2009 , 08:32   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
you may try to supercede the forward and fire another touch.
Try to send another touch with the player you want when you supercede the forward.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 09:38   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Try to send another touch with the player you want when you supercede the forward.
Oh that works Thx
+karma
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2009 , 09:43   Re: [SOLVED] Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #9

I was wrong, you don't need to resend, will post the code in few seconds/minutes.

Ok, tested on my listenserver, so 1 represent(=listenserver) my player id, all other players were BOTs.
Gives me the bomb each new round, you just have to make it works with your code.

PHP Code:
/*    Copyright © 2009, ConnorMcLeod

    Detect c4 is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Detect c4; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Detect c4"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

// #define MAX_PLAYERS    32
#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new g_iMaxPlayersgmsgScoreAttrib

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_iMaxPlayers get_maxplayers()
    
gmsgScoreAttrib get_user_msgid("ScoreAttrib")
    
RegisterHam(Ham_Touch"weapon_c4""C4_Touch")
}

public 
C4_Touch(iEntid)
{
    if( 
IsPlayer(id) && is_user_bot(id) )
    {
        if( 
is_user_alive(1) )
        {
            
SetHamParamEntity(21)
            
SetPlanter(id0)
            
SetPlanter(11)
        }
    }
}

SetPlanter(idbOnOff)
{
    new 
iFlagsiPlantSkill
    
if( bOnOff )
    {
        
iFlags = (1<<1)
        
iPlantSkill 1
    
}

    
cs_set_user_plant(idiPlantSkill// set player ability to plant the bomb (or not)
    
entity_set_int(idEV_INT_bodyiPlantSkill// draw bomb at player's back (or not)

    
message_begin(MSG_BROADCASTgmsgScoreAttrib// show players as bomb carrier in scoreboard (or not)
    
write_byte(id)
    
write_byte(iFlags)
    
message_end()

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-13-2009 at 09:48.
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 06:55   Re: Ham Touch doesn't work on POD BOT-s :(
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
The following code works fine with PodBots, means that the problem is somewhere in your code
Above I said:
Quote:
And also touch hook gets executed always on POD bot-s.. I can see messages in server console, but no result when changing param.
Quote:
With Humans it works perfectly.. But with POD bots..
so if it works perfectly with humans, then error is not is the code, but somethink with bots
don't U think so?

Quote:
Originally Posted by ConnorMcLeod View Post
you may try to supercede the forward and fire another touch.
I was trying to supercede it but then touch is stoping at all.. And I wanna just to change param

Last edited by Empowers; 04-13-2009 at 06:59.
Empowers is offline
Send a message via ICQ to Empowers
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 02:28.


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