Raised This Month: $ Target: $400
 0% 

Fix code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-25-2011 , 12:34   Fix code
Reply With Quote #1

This plugin have some erros on compile, anyone fix for me?


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

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

new pug_botname
new pug_botnumber
new pug_botenable
new g_oldbotname
new g_oldbotid

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pug_botname register_cvar("pug_botname""a")
    
pug_botnumber register_cvar("pug_kickbot""4")
    
pug_botenable register_cvar("pug_botenable""1")
    
    
set_task(5.1,"createbot")
}

public 
createbot()
{
    if( 
get_pcvar_num(pug_botenable) != )
        return;
    
    new 
botname[32]
    
get_pcvar_string(pug_botnamebotname31)
    
// Skip Real Players
    
new id find_player("ia"botname)
    
//Get All players in the server
    
new playersn get_playersnum()
    
    if( !
equali(botnameg_oldbotname) )
    {
        if( 
is_user_connected(g_oldbotid) && is_user_bot(g_oldbotid) )
        {
            
set_user_info(g_oldbotid"name"botname)
            return;
        }
    }
    
    
// If Player not more than 4 Create the bot.
    
if( playersn get_pcvar_num(pug_botnumber) && !id )
    {
        
g_oldbotid id engfunc(EngFunc_CreateFakeClientbotname)
        
        
g_oldbotname botname
        
        
if( pev_validid ) )
        {
            
engfuncEngFunc_FreeEntPrivateDataid)
            
dllfuncMetaFunc_CallGameEntity"player"id)
            
set_user_infoid"rate""25000" )
            
set_user_infoid"cl_updaterate""101" )
            
set_user_infoid"cl_lw""1" )
            
set_user_infoid"cl_lc""1" )
            
set_user_infoid"cl_dlmax""128" )
            
set_user_infoid"cl_righthand""1" )
            
set_user_infoid"_vgui_menus""0" )
            
set_user_infoid"_ah""0" )
            
set_user_infoid"dm""0" )
            
set_user_infoid"tracker""0" )
            
set_user_infoid"friends""0" )
            
set_user_infoid"*bot""1" )
            
set_pevidpev_flagspevidpev_flags ) | FL_FAKECLIENT )
            
set_pevidpev_colormapid )
            
            new 
msg[128]
            
dllfuncDLLFunc_ClientConnectidbotname"127.0.0.1"msg )
            
dllfuncDLLFunc_ClientPutInServerid )
            
engfuncEngFunc_RunPlayerMoveidFloat:{0.0,0.0,0.0}, 0.00.00.00076 )
            
            
fm_set_user_team(idCS_TEAM_CT);
            
dllfunc(DLLFunc_Spawnid)
        }
    }
    
//If Bot Exist and are more than 4 players in the server they will kick bot.
    
else if( playersn get_pcvar_num(pug_botnumber) && id )
    {
        
set_pev(idpev_effectspev(idpev_effects) & ~EF_NODRAW)
        
server_cmd"kick #%d"get_user_userid(id) )
    }
    
// If Bot exist set some stuff to him.
    
else if( id )
    {
        if( !
is_user_alive(id) )
            
dllfunc(DLLFunc_Spawnid)
        
        
set_pev(idpev_effectspev(idpev_effects) & EF_NODRAW)
        
set_pev(idpev_solidSOLID_NOT)
        
set_pev(idpev_takedamageDAMAGE_NO)
        
        
// Set player into spec
        
fix_score_team(id"SPECTATOR")
    }

__________________
kramesa is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-25-2011 , 12:41   Re: Fix code
Reply With Quote #2

Fixed all errors. Don't knwo if it works.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

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

new pug_botname
new pug_botnumber
new pug_botenable
new g_oldbotid

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pug_botname register_cvar("pug_botname""a")
    
pug_botnumber register_cvar("pug_kickbot""4")
    
pug_botenable register_cvar("pug_botenable""1")
    
    
set_task(5.1,"createbot")
}

public 
createbot()
{
    if( 
get_pcvar_num(pug_botenable) != )
        return;
    
    new 
botname[32]
    
get_pcvar_string(pug_botnamebotname31)
    
// Skip Real Players
    
new id find_player("ia"botname)
    
//Get All players in the server
    
new playersn get_playersnum()
    
    if( !
equali(botname"g_oldbotname") )
    {
        if( 
is_user_connected(g_oldbotid) && is_user_bot(g_oldbotid) )
        {
            
set_user_info(g_oldbotid"name"botname)
            return;
        }
    }
    
    
// If Player not more than 4 Create the bot.
    
if( playersn get_pcvar_num(pug_botnumber) && !id )
    {
        
g_oldbotid id engfunc(EngFunc_CreateFakeClientbotname)
            
        if( 
pev_validid ) )
        {
            
engfuncEngFunc_FreeEntPrivateDataid)
            
dllfuncMetaFunc_CallGameEntity"player"id)
            
set_user_infoid"rate""25000" )
            
set_user_infoid"cl_updaterate""101" )
            
set_user_infoid"cl_lw""1" )
            
set_user_infoid"cl_lc""1" )
            
set_user_infoid"cl_dlmax""128" )
            
set_user_infoid"cl_righthand""1" )
            
set_user_infoid"_vgui_menus""0" )
            
set_user_infoid"_ah""0" )
            
set_user_infoid"dm""0" )
            
set_user_infoid"tracker""0" )
            
set_user_infoid"friends""0" )
            
set_user_infoid"*bot""1" )
            
set_pevidpev_flagspevidpev_flags ) | FL_FAKECLIENT )
            
set_pevidpev_colormapid )
            
            new 
msg[128]
            
dllfuncDLLFunc_ClientConnectidbotname"127.0.0.1"msg )
            
dllfuncDLLFunc_ClientPutInServerid )
            
engfuncEngFunc_RunPlayerMoveidFloat:{0.0,0.0,0.0}, 0.00.00.00076 )
            
            
cs_set_user_team(idCS_TEAM_CT)
            
dllfunc(DLLFunc_Spawnid)
        }
    }
    
//If Bot Exist and are more than 4 players in the server they will kick bot.
    
else if( playersn get_pcvar_num(pug_botnumber) && id )
    {
        
set_pev(idpev_effectspev(idpev_effects) & ~EF_NODRAW)
        
server_cmd"kick #%d"get_user_userid(id) )
    }
    
// If Bot exist set some stuff to him.
    
else if( id )
    {
        if( !
is_user_alive(id) )
            
dllfunc(DLLFunc_Spawnid)
        
        
set_pev(idpev_effectspev(idpev_effects) & EF_NODRAW)
        
set_pev(idpev_solidSOLID_NOT)
        
set_pev(idpev_takedamageDAMAGE_NO)
        
        
// Set player into spec
        
cs_set_user_team(idCS_TEAM_SPECTATOR)
    }

__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-25-2011 at 12:49.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-25-2011 , 12:44   Re: Fix code
Reply With Quote #3

ok, thx..
__________________
kramesa is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-25-2011 , 12:49   Re: Fix code
Reply With Quote #4

Mhm edited the code. Try that, no errors.
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
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 14:25.


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