Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Cerere modificare plugin
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
466
Sautefac
[Mentally Stable]
Status: Offline
(since 24-03-2018 14:35)
Joined: 23 Apr 2017
Posts: 32
,
Topics: 12
Location:
Romania
Reputation:
24.1
Posted: 23-03-2018, 16:20:56
| Translate post to:
... (
Click for more languages
)
Am nevoie de o mica modificare la pluginul de fakebot, si anume:
- Daca se poate scoate sa nu mai adauge botii cu numele random din lista, sa-i adauge dupa cum sunt asezati in lista din sursa. (mai pe scurt, cand serverul este full botii sunt dati afara, iar cand reintra nu adauga cate 1 bot cu nume diferit ci poate sa adauge si 3 cu acelasi nume).
Sursa:
Spoiler:
#include amxmodx
#include fakemeta
#define NUMAR_DE_BOTI 3
new g_Query[256];
public plugin_init()
{
set_task( 1.0, "TaskManageBots", .flags="b" );
}
new g_Bot[33], g_BotsCount;
public TaskManageBots(){
static PlayersNum; PlayersNum = get_playersnum( 1 );
if( PlayersNum < get_maxplayers() - 1 && g_BotsCount < NUMAR_DE_BOTI ) {
CreateBot();
} else if( PlayersNum > get_maxplayers() - 1 && g_BotsCount ) {
RemoveBot();
}}
new const g_Names[][]=
{
"DNS:",
"FORUM:",
"IP:"
};
public client_disconnect(i)
{
if( g_Bot[ i ] ) {
g_Bot[ i ] = 0, g_BotsCount -- ;
}
}
RemoveBot(){
static i;
for( i = 1; i <= get_maxplayers(); i++ ) {
if( g_Bot[ i ] ) {
server_cmd( "kick #%d", get_user_userid( i ) );break;
}}}
CreateBot(){
static Bot;
formatex( g_Query, 255, !random_num(0,1)?"%s (%c%c)":"%s - %c%c",g_Names[random_num(0,sizeof(g_Names)-1)],random_num('A','Z'),random_num('A','Z') );Bot = engfunc( EngFunc_CreateFakeClient, g_Query );
if( Bot > 0 &&pev_valid(Bot)) {
dllfunc(MetaFunc_CallGameEntity,"player",Bot);
set_pev(Bot,pev_flags,FL_FAKECLIENT);
set_pev(Bot, pev_model, "");
set_pev(Bot, pev_viewmodel2, "");
set_pev(Bot, pev_modelindex, 0);
set_pev(Bot, pev_renderfx, kRenderFxNone);
set_pev(Bot, pev_rendermode, kRenderTransAlpha);
set_pev(Bot, pev_renderamt, 0.0);
set_pdata_int(Bot,114,0);
message_begin(MSG_ALL,get_user_msgid("TeamInfo"));
write_byte(Bot);
write_string("UNASSIGNED");
message_end();
g_Bot[Bot]=1;
g_BotsCount++;
}
}
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 09-02-2025, 14:59:03
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details