Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Bot Marker - możliwa przeróbka ? :>


  • Zamknięty Temat jest zamknięty
9 odpowiedzi w tym temacie

#1 LinuX

    Pomocny

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:53
Offline

Napisano 07.02.2009 16:40

Witam ;- )

Mam taką prośbę, w zw. z tym pluginem:
http://amxx.pl/viewtopic.php?t=415

czy byłaby możliwość, aby zamienić napis "BOT" na "pr0" albo ":- )" (emotka bez spacji ofc) oraz aby wszyscy gracze od razu po wejsciu na serwer mieli ten napis zamiast pingu?

Oto kod SMA

/*	AMX Mod X script.
    
	Bot Marker plugin

	(c) Copyright 2007, Simon Logic '[email protected]'
	This file is provided AS IS (no warranties).

	Info:
		Allows admin to hide or show bot marker for bots & real users 
		on score table.

	Requirements:
		* AMX/X 1.7x or higher
		* RegEx module

	New cvars:
		* amx_botmarker <-1|0|1> (default=-1)
			control bot marker for bots:
			-1 - do nothing
			 0 - hide
			 1 - show
	
	New commands:
		* amx_botmark <name|#userid|#ip> <0|1>
			set bot marker of custom user

	Changelog:
	
	v1.1.0 [2007-06-17]
	+ added admin command 'amx_botmark'
	v1.0.0 [2007-06-16]
	* public release
*/

#include <amxmodx>
#include <amxmisc>
#include <regex>

#pragma tabsize 4
#pragma ctrlchar ''

#define MY_PLUGIN_NAME    "Bot Marker"
#define MY_PLUGIN_VERSION "1.1.0"
#define MY_PLUGIN_AUTHOR  "Simon Logic"

#define MAX_CLIENTS 32

//#define _DEBUG
//#define _ASSERT

new g_cvarControl
//-----------------------------------------------------------------------------
public plugin_init()
{
	register_plugin(MY_PLUGIN_NAME, MY_PLUGIN_VERSION, MY_PLUGIN_AUTHOR)

	g_cvarControl = register_cvar("amx_botmarker", "-1")
	
	register_concmd("amx_botmark", "cmdSet", ADMIN_SLAY, "<name|#userid|#ip> <0|1>")
	
	register_event("ResetHUD", "onPlayerSpawn", "be")
}
//-----------------------------------------------------------------------------
public onPlayerSpawn(id)
{
	if(is_user_bot(id))
	{
	 	new iValue = get_pcvar_num(g_cvarControl)

		if(iValue > 0)
			set_user_info(id, "*bot", "1")
		else if(!iValue)
			set_user_info(id, "*bot", "0")
	}
}
//-----------------------------------------------------------------------------
public cmdSet(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED

	new arg1[32], arg2[2]

	read_argv(1, arg1, sizeof(arg1)-1) // user address
	read_argv(2, arg2, sizeof(arg2)-1) // bool

	new player = cmd_target_ex(id, arg1, 1)
	
	if(!player)
		return PLUGIN_HANDLED

	new authid[32], name[32], authid2[32], name2[32]

	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	get_user_authid(player, authid2, 31)
	get_user_name(player, name2, 31)

	if(arg2[0] != '0')
		arg2 = "1"
	set_user_info(player, "*bot", arg2)
		
	log_amx("Cmd: "%s<%d><%s><>" changed bot marker to "%s" of "%s<%d><%s><>"", name, get_user_userid(id), authid, arg2, name2, get_user_userid(player), authid2)

	switch(get_cvar_num("amx_show_activity"))
	{
		case 2: client_print(0, print_chat, "ADMIN %s: changed bot marker of %s to %s", name, name2, arg2)
		case 1: client_print(0, print_chat, "ADMIN: changed bot marker of %s to %s", name2, arg2)
	}

	return PLUGIN_HANDLED
}
//-----------------------------------------------------------------------------
stock bool:isIP(const ip[])
{
	static Regex:res
	new iRet
	new sErr[1]

	res = regex_match(ip, "^#d+.d+.d+.d+$", iRet, sErr, 0)
	if(!res)
		return false
	return true
}
//-----------------------------------------------------------------------------
stock copyOffset(const src[], dest[], len, offset=0)
{
	if(!offset)
		copy(dest, len, src)
	else if(offset < strlen(src))
	{
		new iPos = 0
		for(new i=offset; src[i] && iPos<len; i++,iPos++)
		{
			dest[iPos] = src[i]
		}
		dest[iPos] = 0
	}
}
//-----------------------------------------------------------------------------
/* Flags:
*  1 - obey immunity
*  2 - allow yourself
*  4 - must be alive
*  8 - can't be bot */
stock cmd_target_ex(id,const arg[],flags = 1) // extended cmd_target() to support ip
{
	new player = find_player("bl", arg);
	if(player)
	{
		if (player != find_player("blj",arg)) 
		{
#if defined AMXMOD_BCOMPAT
			console_print(id, SIMPLE_T("There are more clients matching to your argument"));
#else
			console_print(id,"%L",id,"MORE_CL_MATCHT");
#endif
			return 0;
		}
	}
	// NOTE: there is implicit search by authid!
	else if((player = find_player("c", arg)) == 0 && arg[0] == '#' && arg[1])
	{
		player = find_player("k", str_to_num(arg[1])); // search by userid
	}

	if(!player && isIP(arg))
	{
		new sIP[16]
		copyOffset(arg, sIP, sizeof(sIP)-1, 1)
		player = find_player("dh", sIP) // search by ip, skip bots
	}
	
	if (!player)
	{
#if defined AMXMOD_BCOMPAT
		console_print(id, SIMPLE_T("Client with that name, userid or ip not found"));
#else
		//console_print(id,"%L",id,"CL_NOT_FOUND");
		console_print(id,"Client with that name, userid or ip not found");
#endif
		return 0;
	}
	if(flags & 1)
	{
		if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) ) 
		{
			new imname[32];
			get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
			console_print(id, SIMPLE_T("Client ^"%s^" has immunity"), imname);
#else
			console_print(id,"%L",id,"CLIENT_IMM",imname);
#endif
			return 0;
		}
	}
	if(flags & 4)
	{
		if (!is_user_alive(player)) 
		{
			new imname[32];
			get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
			console_print(id, SIMPLE_T("That action can't be performed on dead client ^"%s^""), imname);
#else
			console_print(id,"%L",id,"CANT_PERF_DEAD",imname);
#endif
			return 0;
		}
	}
	if(flags & 8)
	{
		if (is_user_bot(player)) 
		{
			new imname[32];
			get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
			console_print(id, SIMPLE_T("That action can't be performed on bot ^"%s^""), imname);
#else
			console_print(id,"%L",id,"CANT_PERF_BOT",imname);
#endif
			return 0;
		}
	}
	return player;
}
//-----------------------------------------------------------------------------


Pozdrawiam
  • +
  • -
  • 0

#2 LinuX

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:53
Offline

Napisano 07.02.2009 17:09

FrikO, jakbyś dał .sma, byłbym wdzięczny :)
  • +
  • -
  • 0

#3 naXe

    Banned

  • Zbanowany

Reputacja: 269
Wszechwidzący

  • Postów:1 489
  • GG:
  • Steam:steam
  • Lokalizacja:Kwidzyn
Offline

Napisano 07.02.2009 17:21

3maj:

Załączone pliki



#4 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.02.2009 17:29

Testowales to w ogóle czy calkiem w ciemno piszesz?
  • +
  • -
  • 0

#5 naXe

    Banned

  • Zbanowany

Reputacja: 269
Wszechwidzący

  • Postów:1 489
  • GG:
  • Steam:steam
  • Lokalizacja:Kwidzyn
Offline

Napisano 07.02.2009 17:37

Testowales to w ogóle czy calkiem w ciemno piszesz?


Testowałem i u mnie śmiga.

#6 Abes Mapper

    Repulsion Gel

  • Przyjaciel

Reputacja: 2 017
Godlike

  • Postów:7 356
  • Steam:steam
  • Imię:Sebastian
  • Lokalizacja:Sulejówek
Offline

Napisano 07.02.2009 18:12

Mi jakoś nie działa. Pokaż screena
  • +
  • -
  • 0

#7 mgr inż. Pavulon

    C35H60Br2N2O4

  • Przyjaciel

Reputacja: 1 742
Godlike

  • Postów:6 881
  • Steam:steam
  • Imię:Konrad
  • Lokalizacja:Koniecpol
Offline

Napisano 07.02.2009 19:35

Zmienił:
71: set_user_info(id, "*bot", "1")
73: set_user_info(id, "*bot", "0")
na:
71: set_user_info(id, "*pr0", "1")
73: set_user_info(id, "*pr0", "0")

oraz:
101: set_user_info(player, "*bot", arg2)
na:
101: set_user_info(player, "*pr0", arg2)

oraz:
219: console_print(id, SIMPLE_T("That action can't be performed on bot ^"%s^""), imname);
na:
219: console_print(id, SIMPLE_T("That action can't be performed on pr0 ^"%s^""), imname);

Czyli w skrócie nic na temat, a i btw. w 99% wg mnie nie ma możliwości edycji tego tekstu zwłaszcza pluginem. A na dodatek nie jest zdefiniowane AMXMOD_BCOMPAT czyli nikt nie zauważy różnicy poza nazwą zmiennej.
  • +
  • -
  • 0

#8 LinuX

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:53
Offline

Napisano 07.02.2009 21:37

hmm, a czy ktoś dałby radę przerobić ten plugin tak jak prosiłem w 1 poście ? :)
  • +
  • -
  • 0

#9 mgr inż. Pavulon

    C35H60Br2N2O4

  • Przyjaciel

Reputacja: 1 742
Godlike

  • Postów:6 881
  • Steam:steam
  • Imię:Konrad
  • Lokalizacja:Koniecpol
Offline

Napisano 07.02.2009 21:54

LinuX, nic z tego nie będzie. Ten plugin tylko ustawia komuś "bota" a nie że ustawia dowolny napis BOT. Takie rzeczy to pewnie tylko w dll'ach.
  • +
  • -
  • 0

#10 LinuX

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:53
Offline

Napisano 07.02.2009 22:01

Pavulon, ok ;] temat do zamknięcia.
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych