Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSSpec bots plugin


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hello can anyone remake this plugin if possible using engine instead o fakemeta module ?

PHP Code:

#include < amxmodx >
#include < cstrike >
#include < fakemeta >

enum Cvars
{
    
botname1,
    
botname2,
    
minplayers,
    
starttime,
    
endtime,
    
onecon,
    
onebot,
    
norounds
};

new const 
cvar_namesCvars ][] =
{
    
"amx_botname",
    
"amx_botname2",
    
"amx_minplayers",
    
"amx_starttime",
    
"amx_endtime",
    
"amx_onecon",
    
"amx_onebot",
    
"amx_norounds"
};

new const 
cvar_defaultsCvars ][] =
{
    
"Bot",
    
"Bot 2",
    
"10",
    
"00",
    
"12",
    
"0",
    
"0",
    
"0"
};

new 
cvar_pointerCvars ];
new 
bool:g_isTime false;
new 
bool:g_ePlayers false;
new 
bool:g_isFirstRound true;
new 
g_BotNum 0g_maxplayersg_bID1g_bID2;

new const 
g_ConfigFile[] = "addons/amxmodx/configs/kgbbots.cfg"

public plugin_init() 
{
    
register_plugin("KGB Bots""2.3""OvidiuS & Desikac")
    
register_cvar("kgbbots""1" , (FCVAR_SERVER|FCVAR_SPONLY))
    
    
register_logevent("Event_RoundEnd"2"1=Round_End");
    
register_event("HLTV""Event_NewRound""a""1=0""2=0");
    
    for ( new 
Cvars:botname1 Cvars i++ )
        
cvar_pointer] = register_cvarcvar_names] , cvar_defaults] );
    
    
g_maxplayers get_maxplayers();
    
server_cmd("exec %s"g_ConfigFile)
    
set_task(3.0"isit")
}

public 
isit() {
    if(
get_pcvar_num(cvar_pointer[norounds]))
        
set_task(30.0"CheckConditions",0,"",0,"b")
}

public 
plugin_precache() 
{
    if(!
file_exists(g_ConfigFile)) 
    {
        
write_file(g_ConfigFile"KGB Bots - Podesavanja^n")
        
write_file(g_ConfigFile"amx_botname ^"KGB Bot1^"   //Ime prvog bota")
        
write_file(g_ConfigFile"amx_botname2 ^"KGB Bot2^"   //Ime drugog bota")
        
write_file(g_ConfigFile"amx_minplayers ^"10^"   //Botovi ce biti ubaceni samo ako je broj igraca manji od ove vrednosti.")
        
write_file(g_ConfigFile"amx_starttime ^"0^"   //Od koliko sati da botovi budu na serveru?")
        
write_file(g_ConfigFile"amx_endtime ^"12^"   //Do koliko sati da botovi budu na serveru?")
        
write_file(g_ConfigFile"amx_onecon ^"0^"   //Da li treba da bude ispunjen samo jedan uslov da bi se dodali botovi?")
        
write_file(g_ConfigFile"amx_onebot ^"0^"   //Da li da plugin ubacuje samo jednog bota?")
        
write_file(g_ConfigFile"amx_norounds ^"0^"   //Da li se na ovom serveru ne zavrsava runda?")
    }
}

public 
Event_RoundEnd()
{
    if (!
g_isFirstRound)
        return;
 
    
g_isFirstRound false;
}

public 
Event_NewRound()
{
    if(
g_isFirstRound)
        return;
        
    
CheckConditions();
}

public 
CheckConditions()
{
    static 
iHoursms
    time
(iHoursms)

    new 
iMin get_pcvar_num(cvar_pointerstarttime ]);
    new 
iMax get_pcvar_num(cvar_pointerendtime ]);
    
    if(
iMin == iMax)
        
g_isTime true;
    else if(
iMin iMax
    {
        switch(
iHours
        {
            case 
0..11
            {
                if(
iMin >= iHours && iMax iHours)
                    
g_isTime true;
            }
            case 
12..23
            {
                if(
iMin <= iHours && iMax iHours)
                    
g_isTime true;
            }
        }
    }
    else if(
iMin <= iHours && iMax iHours)
        
g_isTime true;
    else 
        
g_isTime false;
        
    new 
iNumiPlayers[32];
    
get_players(iPlayersiNum"c");
    
    if(
iNum <= get_pcvar_num(cvar_pointer[minplayers]))
        
g_ePlayers true;
    else
        
g_ePlayers false;

    if(
g_maxplayers iNum 2)
        
g_ePlayers false;
    
    if(
get_pcvar_num(cvar_pointer[minplayers]) == 0)
        
g_ePlayers true
    
    
new iCondition get_pcvar_num(cvar_pointeronecon ]);
    if( (!
g_ePlayers && g_isTime || !g_isTime && g_ePlayers) && iCondition
    {
        
g_isTime true;
        
g_ePlayers true;
    }
    
    
        
    if((
g_isTime && g_ePlayers) && !g_BotNum)
    {
        if(!
get_pcvar_num(cvar_pointer[onebot]))
            
set_task(1.5"Task_AddBot")
        
set_task(2.8"Task_AddBot")
    }
    else if((!
g_isTime || !g_ePlayers) && g_BotNum <= )
    {
        
g_BotNum 0;
        
server_cmd("kick #%d"g_bID1)
        
server_cmd("kick #%d"g_bID2)
    }
}

public 
Task_AddBot()
{
    static 
iBot;
    new 
iBotName[35];
    
    switch(
g_BotNum)
    {
        case 
0get_pcvar_string(cvar_pointerbotname1 ], iBotNamecharsmaxiBotName ));
        case 
1:    get_pcvar_string(cvar_pointerbotname2 ], iBotNamecharsmaxiBotName ));
        case 
2: return;
    }

    
iBot engfuncEngFunc_CreateFakeClientiBotName );
    
    if(!
iBot)
        return;
        
    
dllfuncMetaFunc_CallGameEntity"player"iBot );
    
set_peviBotpev_flagsFL_FAKECLIENT );

    
set_peviBotpev_model"" );
    
set_peviBotpev_viewmodel2"" );
    
set_peviBotpev_modelindex);

    
set_peviBotpev_renderfxkRenderFxNone );
    
set_peviBotpev_rendermodekRenderTransAlpha );
    
set_peviBotpev_renderamt0.0 );

    
set_pdata_intiBot114);
    
cs_set_user_teamiBotCS_TEAM_UNASSIGNED );
    
    switch(
g_BotNum
    {
        case 
0g_bID1 get_user_userid(iBot);
        case 
1g_bID2 get_user_userid(iBot);
    }
    
g_BotNum++;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...