Raised This Month: $32 Target: $400
 8% 

CZ Bots Class name


Post New Thread Reply   
 
Thread Tools Display Modes
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 04-18-2012 , 05:50   Re: CZ Bots Class name
Reply With Quote #11

Quote:
Originally Posted by Doc-Holiday View Post
Ive had issues with mass plugins using this forward... it would continue running and not register the bots... i have been using this method from rage without issue and same load of plugin


http://forums.alliedmods.net/showpos...7&postcount=41
Hurmm strange, but for me it work fine. The 1st code that Connor attached is error, but this 1 no error.

Test result:
Code:
[Ham Test] Bot [13] killed.
[Ham Test] Bot [1] spawned.
[Ham Test] Bot [2] spawned.
[Ham Test] Bot [3] spawned.
[Ham Test] Bot [4] spawned.
[Ham Test] Bot [5] spawned.
[Ham Test] Bot [6] spawned.
[Ham Test] Bot [7] spawned.
[Ham Test] Bot [8] spawned.
[Ham Test] Bot [9] spawned.
[Ham Test] Bot [10] spawned.
[Ham Test] Bot [17] hitted by [15.0] damage.
[Ham Test] Bot [17] hitted by [15.0] damage.
[Ham Test] Bot [17] hitted by [65.0] damage.
[Ham Test] Bot [15] hitted by [195.0] damage.
[Ham Test] Bot [17] hitted by [65.0] damage.
[Ham Test] Bot [17] hitted by [260.0] damage.
[Ham Test] Bot [17] hitted by [114.7] damage.
[Ham Test] Bot [17] hitted by [95.0]
Test plugin:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("Test CZ bot Ham""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawnPost"1)
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
RegisterHam(Ham_TakeDamage"player""OnPlayerTakeDamage")
}

public 
cz_bot_ham_registerable(id)
{
    
RegisterHamFromEntity(Ham_Spawnid"OnPlayerSpawnPost"1)
    
RegisterHamFromEntity(Ham_Killedid"OnPlayerKilled")
    
RegisterHamFromEntity(Ham_TakeDamageid"OnPlayerTakeDamage")
}

public 
OnPlayerSpawnPost(id)
{
    if(!
is_user_alive(id)) return;
    
client_print(0print_chat"[Ham Test] Bot [%i] spawned."id)
}

public 
OnPlayerKilled(id)
{
    
client_print(0print_chat"[Ham Test] Bot [%i] killed."id)
}

public 
OnPlayerTakeDamage(victiminflictorattackerFloat:damagedamagetype)
{
    if(!
is_user_connected(attacker)) return HAM_IGNORED;
    
client_print(attackerprint_chat"[Ham Test] Bot [%i] hitted by [%.1f] damage."victimdamage)
    
    return 
HAM_IGNORED;

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 04-18-2012 at 06:12.
yokomo is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-18-2012 , 14:54  
Reply With Quote #12

I dont get an error it just seems like if i have to many plugins running with this it would stop working so i removed the forward and plugin and used the rage one and it all worked fine. But if i ran one or two plugins using his forward it wouldnt work. Tried even addig forward blah like he said.

Also tried to move it arohnd in the plugins ini. But same results everywhere
Doc-Holiday is offline
Old 05-08-2012, 18:02
ConnorMcLeod
This message has been deleted by ConnorMcLeod. Reason: Code on next post
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 05-09-2012 , 00:22   Re: CZ Bots Class name
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
That version with fakemeta should also works fine, if someone has some trouble with other one.

Spoiler
Waa this 1 is simple coded. Gonna try this version, thanks for share.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-24-2012 , 01:05   Re: CZ Bots Class name
Reply With Quote #14

Little update, should filter cz bots from other bots :

Spoiler
Attached Files
File Type: sma Get Plugin or Get Source (ham_register_cz_bots.sma - 631 views - 1.2 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-23-2012 at 01:40.
ConnorMcLeod is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-02-2014 , 20:28   Re: CZ Bots Class name
Reply With Quote #15

My version:
Spoiler

Example plugin:
Spoiler

P.S. sorry for up topic
__________________

Last edited by PRoSToTeM@; 01-02-2014 at 21:13.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 11:54.


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