Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

mp_teamplay help !
http://aghl.ru/forum/viewtopic.php?f=20&t=2225
Страница 1 из 2

Автор:  Kuma77 [ 11 июл 2015, 22:10 ]
Заголовок сообщения:  mp_teamplay help !

i want to add random skins for red team at spawn eg:
when red team is spawn then set random skin player from a string { red1, red2, red3 } without change mp_teamlist "blue;red"

Автор:  Lev [ 11 июл 2015, 23:08 ]
Заголовок сообщения:  Re: mp_teamplay help !

The code in HLSDK almost everywhere use model name as team name. So this is not possible while you will not change that code in HLSDK.
Or, may be, somehow substitute model name when sending to other clients, so it will just appear as different model.

Автор:  Kuma77 [ 11 июл 2015, 23:38 ]
Заголовок сообщения:  Re: mp_teamplay help !

Lev писал(а):
The code in HLSDK almost everywhere use model name as team name. So this is not possible while you will not change that code in HLSDK.
yes know it but ...
Lev писал(а):
substitute model name when sending to other clients, so it will just appear as different model
about this , i just want edit hl zombie plugin and add more zombies skins now you understand better :) !
i think its not impossible on hl !

Автор:  Lev [ 12 июл 2015, 01:14 ]
Заголовок сообщения:  Re: mp_teamplay help !

Sure, it is possible, but will require some work for this.

Автор:  unnamed [ 12 июл 2015, 01:45 ]
Заголовок сообщения:  Re: mp_teamplay help !

Код:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>


#define PLUGIN   "Test"
#define AUTHOR   "LetiLetiLepestok"
#define VERSION   "1.0"

new g_asModels[33][32]

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_forward(FM_SetClientKeyValue, "SetClientKeyValue");
   register_clcmd("set_model", "set_player_mdl")
}


public set_player_mdl(player)
{
   new sModel[32]
   read_argv(1, sModel, charsmax(sModel))
   trim(sModel)
   remove_quotes(sModel)
   if(equal(sModel, ""))
      g_asModels[player] = ""

   g_asModels[player] = sModel
   
   set_user_info(player, "model", g_asModels[player])   
   return PLUGIN_HANDLED
}


public SetClientKeyValue(player, const szInfoBuffer[], const szKey[], const szValue[])
{
   if( equal(szKey, "model") && is_user_connected(player) && !equal(g_asModels[player], ""))
      return FMRES_SUPERCEDE

   return FMRES_IGNORED
}

Автор:  Kuma77 [ 12 июл 2015, 03:47 ]
Заголовок сообщения:  Re: mp_teamplay help !

unnamed
i want to keep teams as red and blue on "scoreboard" but change models skin only
Цитата:
* Can't change team to 'xx'
* Server limits teams to 'blue;red'

Автор:  unnamed [ 12 июл 2015, 04:48 ]
Заголовок сообщения:  Re: mp_teamplay help !

Kuma77 писал(а):
unnamed
i want to keep teams as red and blue on "scoreboard" but change models skin only

I can set gman (for example) model at my server with mp_teamlist 'blue;red'

Цитата:
* Can't change team to 'xx'
* Server limits teams to 'blue;red'

Ignore that.
Server can't change team, but visible model changes.

Автор:  Kuma77 [ 12 июл 2015, 07:25 ]
Заголовок сообщения:  Re: mp_teamplay help !

unnamed
Цитата:
Ignore that.
Thx its work perfect

Edit :
i fix it thx Lev, unnamed
Код:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

#define PLUGIN   "Test"
#define AUTHOR   "LetiLetiLepestok"
#define VERSION   "1.0"

#define RANDOMSKINS 3

new const Set_Classes[ RANDOMSKINS][] =
{
    "blue",
    "red",
    "helmet"
}
new g_asModels[33][32]

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_forward(FM_SetClientKeyValue, "SetClientKeyValue");
   register_clcmd("set_model", "set_player_mdl")
   register_clcmd("say ss", "set_views")
   register_clcmd("say gg", "set_test")
}
public set_views(id)
   set_view(id, CAMERA_3RDPERSON)  // i use this to see if my skin is changed :)

public set_test(id)
   client_cmd(id, "set_model %s", Set_Classes[random(RANDOMSKINS)])
public set_player_mdl(player)
{
   new sModel[32]
   read_argv(1, sModel, charsmax(sModel))
   trim(sModel)
   remove_quotes(sModel)
   if(equal(sModel, ""))
   g_asModels[player] = ""

   g_asModels[player] = sModel
   
   set_user_info(player, "model", g_asModels[player])   
   return PLUGIN_HANDLED
}
public SetClientKeyValue(player, const szInfoBuffer[], const szKey[], const szValue[])
{
   if( equal(szKey, "model") && is_user_connected(player) && !equal(g_asModels[player], ""))
      return FMRES_SUPERCEDE

   return FMRES_IGNORED
}

Автор:  abdobiskra [ 12 июл 2015, 09:27 ]
Заголовок сообщения:  Re: mp_teamplay help !

you can try this but i did not try it
i do not know that answer your question !
Код:
/* AMX Mod X

   http://aghl.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community

   This file is provided as is (no warranties)
*/

#include <amxmodx>

#define AUTHOR "Lev"
#define PLUGIN "Teams Randomizer"
#define VERSION "0.1"

new const g_Teams[][] = {
   "blue;red",
   "blue1;red1",
   "blue2;red2"
}

public plugin_precache()
{
   new mp_teamlist[64];
   get_cvar_string("mp_teamlist", mp_teamlist, charsmax(mp_teamlist));
   new i, c = sizeof(g_Teams);
   server_print("--- %i", c);
   for (i = 0; i < c; i++)
   {
      if (equali(g_Teams[i], mp_teamlist))
         break;
   }
   i++;
   if (i >= c)
      i = 0;
   set_cvar_string("mp_teamlist", g_Teams[i]);
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR);
}

Автор:  Kuma77 [ 12 июл 2015, 09:57 ]
Заголовок сообщения:  Re: mp_teamplay help !

abdobiskra
Thx but i dont want to change mp_teamlist ""

Страница 1 из 2 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/