AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] RegisterHam for csbots? (https://forums.alliedmods.net/showthread.php?t=272844)

CrazY. 10-07-2015 15:50

[HELP] RegisterHam for csbots?
 
Hi , I tried to register a ham to the csbots but i am getting a compile error , the code is this:

PHP Code:

RegisterHam(Ham_Spawn"player""fw_HamPlayerSpawnPost"1true); 


wickedd 10-07-2015 16:05

Re: [HELP] RegisterHam with csbots?
 
Quote:

Originally Posted by CrazY. (Post 2350703)
Hi , I tried to register a ham to the csbots but i am getting a compile error , the code is this:

PHP Code:

RegisterHam(Ham_Spawn"player""fw_HamPlayerSpawnPost"1true); 


What are you talking about? Your post doesn't make any sense. Post your code and explain what you're trying to do.

redivcram 10-07-2015 16:48

Re: [HELP] RegisterHam with csbots?
 
Post your full code and the error

CrazY. 10-07-2015 17:12

Re: [HELP] RegisterHam with csbots?
 
Guys , I am wanting to register a ham for bots without the use of cs_ham_bots_api , that's the code:

PHP Code:

#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < zombieplague >

new bot_weapons[][] = 
{
    
"weapon_m4a1",
    
"weapon_ak47",
    
"weapon_sg552"
}

public 
plugin_init() 
{
    
register_plugin("[ZP] CS/CZ Bot Weapons""4.3""CrazY");
    
RegisterHam(Ham_Spawn"player""fw_HamBotSpawnPost"1true);
}

public 
fw_HamBotSpawnPost(id)
{
    if(
is_user_alive(id) && is_user_bot(id))
    {
        new 
size_bot_weapons random(sizeof bot_weapons);
        
give_item(idbot_weapons[size_bot_weapons]);
        
cs_set_user_bpammo(idget_weaponid(bot_weapons[size_bot_weapons]), 90);
    }
}

public 
zp_user_humanized_post(id)
{
    if(
is_user_bot(id) && !zp_get_user_survivor(id))
    {
        new 
size_bot_weapons random(sizeof bot_weapons);
        
give_item(idbot_weapons[size_bot_weapons]);
        
cs_set_user_bpammo(idget_weaponid(bot_weapons[size_bot_weapons]), 90);
    }



wickedd 10-07-2015 18:00

Re: [HELP] RegisterHam with csbots?
 
Quote:

Originally Posted by CrazY. (Post 2350733)
Guys , I am wanting to register a ham for bots without the use of cs_ham_bots_api

This doesn't make sense. What do you mean register ham for bots? Anyway, you can use is_user_bot(). Since you didn't post the full code tell us what's not working.

Hartmann 10-07-2015 18:11

Re: [HELP] RegisterHam with csbots?
 
https://forums.alliedmods.net/showpo...2&postcount=15

yokomo 10-08-2015 01:31

Re: [HELP] RegisterHam with csbots?
 
Quote:

Originally Posted by CrazY. (Post 2350703)
Hi , I tried to register a ham to the csbots but i am getting a compile error , the code is this:

PHP Code:

RegisterHam(Ham_Spawn"player""fw_HamPlayerSpawnPost"1true); 


You need a whole new amxmodx 1.8.3 developer build package, this feature only exist on new hamsandwich module. Official amxmodx 1.8.2 doesn't have this function.

From hamsandwich.inc (amxmodx 1.8.3 dev):
Quote:

/**
* Hooks the virtual table for the specified entity class.
* An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt");
* Look at the Ham enum for parameter lists.
*
* @param function The function to hook.
* @param EntityClass The entity classname to hook.
* @param callback The forward to call.
* @param post Whether or not to forward this in post.
* @param specialbot Whether or not to enable support for bot without "player" classname.
* @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off.
*/
native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0, bool:specialbot = false);

CrazY. 10-08-2015 06:39

Re: [HELP] RegisterHam with csbots?
 
Quote:

Originally Posted by Hartmann (Post 2350746)

I did not understand.

Quote:

Originally Posted by yokomo (Post 2350835)
You need a whole new amxmodx 1.8.3 developer build package, this feature only exist on new hamsandwich module. Official amxmodx 1.8.2 doesn't have this function.

From hamsandwich.inc (amxmodx 1.8.3 dev):

If you only update the hansadwich work?


All times are GMT -4. The time now is 22:15.

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