Jump to content

Cerere plugin


floringold

Recommended Posts

1 hour ago, floringold said:

Descriere detaliata:vreau un plugin bun sa meargă player bot 2 boti sa stea spectatori automat si sa dispară cand le dau eu kick 

Nu exista asa ceva , bot-ul este pus sa stea la spec non-stop. Poti doar sa scoti cvar-ul si bot-ul sa nu mai fie pe server.

Quote

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

#define PLUGIN "Bot-Fake"
#define VERSION "1.0"
#define AUTHOR "Author"

new g_pEnable;
new g_pBotName;
new g_pMaxPlayers;

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   g_pEnable = register_cvar("bw_enable", "1");
   g_pBotName = register_cvar("bw_botname", "Nume-bot");
   g_pMaxPlayers = register_cvar("bw_maxplayers", "22");
   
   if( get_pcvar_num(g_pEnable) ) 
   {
      set_task( 5.0, "CreateBot" );
   }
}

public client_connect(id)
{
   if( get_playersnum() >= get_pcvar_num(g_pMaxPlayers) )
   {
      new szBotName[33];
      get_pcvar_string(g_pBotName, szBotName, 32);
      server_cmd("kick ^"%s^"", szBotName);
   }
}

public CreateBot()
{
   new szBotName[33];
   get_pcvar_string(g_pBotName, szBotName, 32);
            
   new id = engfunc(EngFunc_CreateFakeClient, szBotName);
   engfunc(EngFunc_FreeEntPrivateData, id);
   set_pev(id, pev_flags, pev( id, pev_flags ) | FL_FAKECLIENT);
            
   new szMsg[128];
   dllfunc(DLLFunc_ClientConnect, id, szBotName, "127.0.0.1", szMsg);
   dllfunc(DLLFunc_ClientPutInServer, id);
}

Cvar-uri pentru functionarea bot-ului.

Quote

bw_enable 1 - 1 activat/0-dezactivat
bw_botname "Nume Bot" - Adauga numele botului
bw_maxplayers 32- Cand intra n% playeri sa iasa botul de pe server

le adaugi in amxx.cfg

 

P.S. Data viitoare incerca sa scrii titlul cu numele plugin-ului pe care îl vrei. Ex: Cerere plugin - BotSpec. Deoarece poate și alte persoane au acceasi întrebare și se crează un nou topic. Mulțumesc frumos de înțelegere.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...