Редактиране на Temporary Admin добяване на ник и парола

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
PreDatoR
Потребител
Потребител
Мнения: 21
Регистриран: 15 дек 2018, 13:23

Редактиране на Temporary Admin добяване на ник и парола

Мнение от PreDatoR » 12 юни 2019, 21:34

Добър вечер!Плъгинат добавя временният админ по стеам ид, ако е възможно това да се замести с име и парола, да не ги регистрира по стеам ид .Благодаря предварително!

Код: Избери всички

/* AMXMOD X script.
*
* Scripted by GHW.Chronic
*
*   v1.2 - Admin Automatically Gets Admin, No Name Changing Or Map Change To Get His Admin
*        - Permanent Admin Capabilities Added
*        - User's Name Is Added To The Users.ini File
*        - Temp-Admin Removal Is Logged
*
*   v1.0 - Initial Release
*
*/

#include <amxmodx>
#include <amxmisc>

new tempname[33][32]

public plugin_init()
{
	register_plugin("Temporary Admin", "1.2", "GHW_Chronic")
        register_concmd("amx_tempadmin","amx_tempadmin",ADMIN_RCON," <NAME> <Days to have admin (0=infinate)> <Flags(find out flags in users.ini file)> ")
	register_cvar("days","0")
	register_cvar("months","0")
	register_cvar("years","0")
	register_cvar("tempid","0")
	register_cvar("cvar_i_ta","0")
	register_cvar("flags","bcdefghijklmnopqrstu")
	set_task(5.0,"check_date",0)
	return PLUGIN_CONTINUE
}

public check_date()
{
	new todaysmonth[32]
	new todaysday[32]
	new todaysyear[32]
	get_time("%m",todaysmonth,31)
	get_time("%d",todaysday,31)
	get_time("%Y",todaysyear,31)
	new todaysdaynum = str_to_num(todaysday)
	new todaysmonthnum = str_to_num(todaysmonth)
	new todaysyearnum = str_to_num(todaysyear)
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)

	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users2.ini",configdir)

	new filelen1
	new filesays1[32]
	new i = get_cvar_num("cvar_i_ta")

	new configfile2[200]
	format(configfile2,199,"%s/users.ini",configdir)

	read_file(configfile1,i,filesays1,31,filelen1)
	new filesays3[200]
	format(filesays3,199,"%s",filesays1)
	new i2 = i + 1
	if(i>401)
	{
		set_cvar_num("cvar_i_ta",0)
		return PLUGIN_HANDLED
	}

	if(equal(filesays3,alltogether))
	{
		new filesays2[5]
		new txtLen
		read_file(configfile1,i2,filesays2,4,txtLen)
		new filesays5 = str_to_num(filesays2)

		write_file(configfile2,";Temp-Admin's Name Use To Be here. Do not remove this line unless it is the last line in the users.ini file.",filesays5)
		write_file(configfile1,";Old Date Use To Be Here.",i)
		new aaa = filesays5 - 1
		new aaaa[32]
		read_file(configfile2,aaa,aaaa,31,txtLen)
		new holder769[200]
		format(holder769,199,"say Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		log_amx("Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		server_cmd(holder769)
	}
	set_cvar_num("cvar_i_ta",i2)
	set_task(0.0, "check_date")
	return PLUGIN_HANDLED
}

public amx_tempadmin(id,level,cid)
{
	if ( !cmd_access(id,level,cid,4) )
	{
		return PLUGIN_HANDLED
	}
	new arg1[63]
	new arg2[63]
	new arg3[63]
	read_argv(1,arg1,63)
	read_argv(2,arg2,63)
	read_argv(3,arg3,63)
	set_cvar_string("flags",arg3)
	new arg22 = str_to_num(arg2)
	new plist[32]
	new pnum
	get_players(plist,pnum,"c")
	new tempid2 = find_player("bl",arg1)
	set_cvar_num("tempid",tempid2)
	set_cvar_num("findays",arg22)
	new temp_connected = is_user_connected(tempid2)
	if(temp_connected==1)
	{
		if(str_to_num(arg2)==0 || str_to_num(arg2)>=900)
		{
			new instertintousers[200]
			new instertintousersname[200]
			get_user_name(tempid2,tempname[tempid2],31)
			new tempsauthid[32]
			get_user_authid(tempid2,tempsauthid,31)
			format(instertintousers,199,"^"%s^" ^"^" ^"%s^" ^"ce^"",tempsauthid,arg3)
			new configdir[200]
			get_configsdir(configdir,199)
			new configfile1[200]
			format(configfile1,199,"%s/users.ini",configdir)
			write_file(configfile1,"",-1)
			format(instertintousersname,199,";%s",tempname[tempid2])
			write_file(configfile1,instertintousersname,-1)
			write_file(configfile1,instertintousers,-1)
			server_cmd("amx_reloadadmins")
			client_cmd(tempid2,"name PermanentAdmin")
			set_task(5.0,"changename",tempid2)
			console_print(id,"Permanent-Admin Has Been Added. He Now Has Admin.")
			return PLUGIN_HANDLED
		}
		set_cvar_num("tempid",tempid2)
		new todaysmonth[32]
		new todaysday[32]
		new todaysyear[32]
		get_time("%m",todaysmonth,31)
		get_time("%d",todaysday,31)
		get_time("%Y",todaysyear,31)
		new todaysdaynum = str_to_num(todaysday)
		new todaysmonthnum = str_to_num(todaysmonth)
		new todaysyearnum = str_to_num(todaysyear)
		new newday = todaysdaynum + arg22
		set_cvar_num("days",newday)
		set_cvar_num("months",todaysmonthnum)
		set_cvar_num("years",todaysyearnum)
		if(todaysmonthnum==1)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==2)
		{
			if(newday>28)
			{
				set_task(0.0, "february")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==3)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==4)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==5)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==6)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==7)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==8)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==9)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==10)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==11)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==12)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		return PLUGIN_HANDLED
	}
	else
	{
		console_print(id,"No Player With That Name Exists")
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public makenewdate()
{
	new endday = get_cvar_num("days")
	new endmonth = get_cvar_num("months")
	new endyear = get_cvar_num("years")
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",endmonth,endday,endyear)
	new arg3[64]
	get_cvar_string("flags",arg3,63)
	new instertintousers[200]
	new instertintousersname[200]
	new tempsid2 = get_cvar_num("tempid")
	get_user_name(tempsid2,tempname[tempsid2],31)
	new tempsauthid[32]
	get_user_authid(tempsid2,tempsauthid,31)
	format(instertintousers,199,"^"%s^" ^"^" ^"%s^" ^"ce^"",tempsauthid,arg3)
	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users.ini",configdir)
	write_file(configfile1,"",-1)
	format(instertintousersname,199,";%s",tempname[tempsid2])
	write_file(configfile1,instertintousersname,-1)
	write_file(configfile1,instertintousers,-1)
	new line = file_size(configfile1,1)
	new line2 = line - 2
	new line3[200]
	format(line3,199,"%d",line2)
	new configfile2[200]
	format(configfile2,199,"%s/users2.ini",configdir)
	write_file(configfile2,alltogether,-1)
	write_file(configfile2,line3,-1)
	server_cmd("amx_reloadadmins")
	client_cmd(tempsid2,"name TempAdmin")
	set_task(5.0,"changename",tempsid2)
	console_print(0,"Temp-VIP Has Been Added. He Now Has VIP.")
	return PLUGIN_HANDLED
}

public changename(id)
{
	new holder444[200]
	format(holder444,199,"name ^"%s^"",tempname[id])
	client_cmd(id,holder444)
	return PLUGIN_HANDLED
}
public thirtyone()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public thirty()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>30)
	{
		new ndays2 = ndays - 30
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public february()
{
	new ndays = get_cvar_num("days")
	if(ndays>28)
	{
		new ndays2 = ndays - 28
		set_cvar_num("days",ndays2)
		set_cvar_num("months",3)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public newyear()
{
	new ndays = get_cvar_num("days")
	new nyears = get_cvar_num("years")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nyears2 = nyears + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",1)
		set_cvar_num("years",nyears2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public select_days()
{
	new nmonths = get_cvar_num("months")
	if(nmonths==1)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==2)
	{
		set_task(0.0, "february")
	}
	if(nmonths==3)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==4)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==5)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==6)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==7)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==8)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==9)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==10)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==11)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==12)
	{
		set_task(0.0, "newyear")
	}
	return PLUGIN_HANDLED
}
93.123.18.59:27016

Потребителски аватар

mBFF-TheFucKBG CSNatioN
Потребител
Потребител
Мнения: 312
Регистриран: 09 ное 2018, 16:40
Местоположение: Сливен
Се отблагодари: 13 пъти
Получена благодарност: 11 пъти
Години: 15

Редактиране на Temporary Admin добяване на ник и парола

Мнение от mBFF-TheFucKBG CSNatioN » 13 юни 2019, 06:36

Защо не ползваш BecomeAdmin плъгина на hacker457 ?

П.С удобен е,добре написан и така.
Фенче на СкандаУ <3

Потребителски аватар

blazz3rzbg NSFW
AMXX Скриптър
AMXX Скриптър
Мнения: 43
Регистриран: 22 фев 2019, 14:38
Местоположение: Стара Загора
Се отблагодари: 12 пъти
Получена благодарност: 13 пъти
Години: 18

Редактиране на Temporary Admin добяване на ник и парола

Мнение от blazz3rzbg NSFW » 14 юни 2019, 03:14

Код: Избери всички

/* AMXMOD X script.
*
* Scripted by GHW.Chronic
*
*   v1.2 - Admin Automatically Gets Admin, No Name Changing Or Map Change To Get His Admin
*        - Permanent Admin Capabilities Added
*        - User's Name Is Added To The Users.ini File
*        - Temp-Admin Removal Is Logged
*
*   v1.0 - Initial Release
*
*/

#include <amxmodx>
#include <amxmisc>

new tempname[33][32]
new pass[128];

public plugin_init()
{
	register_plugin("Temporary Admin", "1.2", "GHW_Chronic")
        register_concmd("amx_tempadmin","amx_tempadmin",ADMIN_RCON," <NAME> <Days to have admin (0=infinate)> <Flags(find out flags in users.ini file)> <Password>")
	register_cvar("days","0")
	register_cvar("months","0")
	register_cvar("years","0")
	register_cvar("tempid","0")
	register_cvar("cvar_i_ta","0")
	register_cvar("flags","bcdefghijklmnopqrstu")
	set_task(5.0,"check_date",0)
	return PLUGIN_CONTINUE
}

public check_date()
{
	new todaysmonth[32]
	new todaysday[32]
	new todaysyear[32]
	get_time("%m",todaysmonth,31)
	get_time("%d",todaysday,31)
	get_time("%Y",todaysyear,31)
	new todaysdaynum = str_to_num(todaysday)
	new todaysmonthnum = str_to_num(todaysmonth)
	new todaysyearnum = str_to_num(todaysyear)
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)

	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users2.ini",configdir)

	new filelen1
	new filesays1[32]
	new i = get_cvar_num("cvar_i_ta")

	new configfile2[200]
	format(configfile2,199,"%s/users.ini",configdir)

	read_file(configfile1,i,filesays1,31,filelen1)
	new filesays3[200]
	format(filesays3,199,"%s",filesays1)
	new i2 = i + 1
	if(i>401)
	{
		set_cvar_num("cvar_i_ta",0)
		return PLUGIN_HANDLED
	}

	if(equal(filesays3,alltogether))
	{
		new filesays2[5]
		new txtLen
		read_file(configfile1,i2,filesays2,4,txtLen)
		new filesays5 = str_to_num(filesays2)

		write_file(configfile2,";Temp-Admin's Name Use To Be here. Do not remove this line unless it is the last line in the users.ini file.",filesays5)
		write_file(configfile1,";Old Date Use To Be Here.",i)
		new aaa = filesays5 - 1
		new aaaa[32]
		read_file(configfile2,aaa,aaaa,31,txtLen)
		new holder769[200]
		format(holder769,199,"say Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		log_amx("Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		server_cmd(holder769)
	}
	set_cvar_num("cvar_i_ta",i2)
	set_task(0.0, "check_date")
	return PLUGIN_HANDLED
}

public amx_tempadmin(id,level,cid)
{
	if ( !cmd_access(id,level,cid,4) )
	{
		return PLUGIN_HANDLED
	}
	new arg1[63]
	new arg2[63]
	new arg3[63]
	new arg4[63]
	read_argv(1,arg1,63)
	read_argv(2,arg2,63)
	read_argv(3,arg3,63)
	read_argv(4,arg4,63)
	formatex(pass, charsmax(pass), "%s", read_argv(4,arg4,63));
	set_cvar_string("flags",arg3)
	new arg22 = str_to_num(arg2)
	new plist[32]
	new pnum
	get_players(plist,pnum,"c")
	new tempid2 = find_player("bl",arg1)
	set_cvar_num("tempid",tempid2)
	set_cvar_num("findays",arg22)
	new temp_connected = is_user_connected(tempid2)
	if(temp_connected==1)
	{
		if(str_to_num(arg2)==0 || str_to_num(arg2)>=900)
		{
			new instertintousers[200]
			new instertintousersname[200]
			get_user_name(tempid2,tempname[tempid2],31)
			//new tempsauthid[32]
			//get_user_authid(tempid2,tempsauthid,31)
			format(instertintousers,199,"^"%s^" ^"%s^" ^"%s^" ^"a^"", tempname[tempid2], arg4, arg3)
			new configdir[200]
			get_configsdir(configdir,199)
			new configfile1[200]
			format(configfile1,199,"%s/users.ini",configdir)
			write_file(configfile1,"",-1)
			format(instertintousersname,199,";%s",tempname[tempid2])
			write_file(configfile1,instertintousersname,-1)
			write_file(configfile1,instertintousers,-1)
			server_cmd("amx_reloadadmins")
			client_cmd(tempid2,"name PermanentAdmin")
			set_task(5.0,"changename",tempid2)
			console_print(id,"Permanent-Admin Has Been Added. He Now Has Admin.")
			return PLUGIN_HANDLED
		}
		set_cvar_num("tempid",tempid2)
		new todaysmonth[32]
		new todaysday[32]
		new todaysyear[32]
		get_time("%m",todaysmonth,31)
		get_time("%d",todaysday,31)
		get_time("%Y",todaysyear,31)
		new todaysdaynum = str_to_num(todaysday)
		new todaysmonthnum = str_to_num(todaysmonth)
		new todaysyearnum = str_to_num(todaysyear)
		new newday = todaysdaynum + arg22
		set_cvar_num("days",newday)
		set_cvar_num("months",todaysmonthnum)
		set_cvar_num("years",todaysyearnum)
		if(todaysmonthnum==1)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==2)
		{
			if(newday>28)
			{
				set_task(0.0, "february")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==3)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==4)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==5)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==6)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==7)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==8)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==9)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==10)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==11)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==12)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		return PLUGIN_HANDLED
	}
	else
	{
		console_print(id,"No Player With That Name Exists")
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public makenewdate()
{
	new endday = get_cvar_num("days")
	new endmonth = get_cvar_num("months")
	new endyear = get_cvar_num("years")
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",endmonth,endday,endyear)
	new arg3[64]
	get_cvar_string("flags",arg3,63)
	new instertintousers[200]
	new instertintousersname[200]
	new tempsid2 = get_cvar_num("tempid")
	get_user_name(tempsid2,tempname[tempsid2],31)
	//new tempsauthid[32]
	//get_user_authid(tempsid2,tempsauthid,31)
	format(instertintousers,199,"^"%s^" ^"%s^" ^"%s^" ^"a^"", tempname[tempsid2], pass, arg3)
	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users.ini",configdir)
	write_file(configfile1,"",-1)
	format(instertintousersname,199,";%s",tempname[tempsid2])
	write_file(configfile1,instertintousersname,-1)
	write_file(configfile1,instertintousers,-1)
	new line = file_size(configfile1,1)
	new line2 = line - 2
	new line3[200]
	format(line3,199,"%d",line2)
	new configfile2[200]
	format(configfile2,199,"%s/users2.ini",configdir)
	write_file(configfile2,alltogether,-1)
	write_file(configfile2,line3,-1)
	server_cmd("amx_reloadadmins")
	client_cmd(tempsid2,"name TempAdmin")
	set_task(5.0,"changename",tempsid2)
	console_print(0,"Temp-VIP Has Been Added. He Now Has VIP.")
	formatex(pass, charsmax(pass), "");
	return PLUGIN_HANDLED
}

public changename(id)
{
	new holder444[200]
	format(holder444,199,"name ^"%s^"",tempname[id])
	client_cmd(id,holder444)
	return PLUGIN_HANDLED
}
public thirtyone()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public thirty()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>30)
	{
		new ndays2 = ndays - 30
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public february()
{
	new ndays = get_cvar_num("days")
	if(ndays>28)
	{
		new ndays2 = ndays - 28
		set_cvar_num("days",ndays2)
		set_cvar_num("months",3)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public newyear()
{
	new ndays = get_cvar_num("days")
	new nyears = get_cvar_num("years")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nyears2 = nyears + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",1)
		set_cvar_num("years",nyears2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public select_days()
{
	new nmonths = get_cvar_num("months")
	if(nmonths==1)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==2)
	{
		set_task(0.0, "february")
	}
	if(nmonths==3)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==4)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==5)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==6)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==7)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==8)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==9)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==10)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==11)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==12)
	{
		set_task(0.0, "newyear")
	}
	return PLUGIN_HANDLED
}
amx_tempadmin <NAME> <Days to have admin (0=infinate)> <Flags(find out flags in users.ini file)> <Password>

Имай в предвит ,че плъгина е доста зле написан!

Потребителски аватар

Автор на темата
PreDatoR
Потребител
Потребител
Мнения: 21
Регистриран: 15 дек 2018, 13:23

Редактиране на Temporary Admin добяване на ник и парола

Мнение от PreDatoR » 14 юни 2019, 21:08

Излиза ми следното, проблем ли е ? Ще дава ли грешки за напред?!
Warning: Unreachable code on line 166
Warning: Unreachable code on line 180
Warning: Unreachable code on line 194
Warning: Unreachable code on line 208
Warning: Unreachable code on line 222
Warning: Unreachable code on line 236
Warning: Unreachable code on line 250
Warning: Unreachable code on line 264
Warning: Unreachable code on line 278
Warning: Unreachable code on line 292
Warning: Unreachable code on line 306
Warning: Unreachable code on line 320
Warning: Unreachable code on line 329

13 Warnings.
Done.
93.123.18.59:27016

Потребителски аватар

OciXCrom TM
Администратор
Администратор
Мнения: 5452
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 94 пъти
Получена благодарност: 622 пъти
Години: 22
Контакти:

Редактиране на Temporary Admin добяване на ник и парола

Мнение от OciXCrom TM » 14 юни 2019, 21:10

Тези предупреждения ги дава и в оригиналния код. Не пречат по никакъв начин в работата на плъгина или компилацията и можеш да ги игнорираш.

Потребителски аватар

Автор на темата
PreDatoR
Потребител
Потребител
Мнения: 21
Регистриран: 15 дек 2018, 13:23

Редактиране на Temporary Admin добяване на ник и парола

Мнение от PreDatoR » 14 юни 2019, 22:18

След регистрирацията му замества ника име " TempAdmin " , а паролата в user.ini изглежда по начин, някакъв шифър (код) но не и паролата,която е написа.
93.123.18.59:27016

Потребителски аватар

blazz3rzbg NSFW
AMXX Скриптър
AMXX Скриптър
Мнения: 43
Регистриран: 22 фев 2019, 14:38
Местоположение: Стара Загора
Се отблагодари: 12 пъти
Получена благодарност: 13 пъти
Години: 18

Редактиране на Temporary Admin добяване на ник и парола

Мнение от blazz3rzbg NSFW » 14 юни 2019, 23:40

странно при мен при добавянето на админ си работи и си слага паролата както трябва и всичко... моля обясни как точно действаш ти ако ли не ще изработя 1 чисто нов код

Потребителски аватар

M36
Потребител
Потребител
Мнения: 62
Регистриран: 19 фев 2019, 11:34
Се отблагодари: 7 пъти

Редактиране на Temporary Admin добяване на ник и парола

Мнение от M36 » 15 юни 2019, 11:03

blazz3rzbg написа:
14 юни 2019, 23:40
странно при мен при добавянето на админ си работи и си слага паролата както трябва и всичко... моля обясни как точно действаш ти ако ли не ще изработя 1 чисто нов код
единият проблем с името го видях къде е ред №365

Код: Избери всички

client_cmd(tempsid2,"name TempAdmin")
направих следното

Код: Избери всички

client_cmd(tempsid2,"name")
и се получи, но това със паролата нещо не се получава, зададената парола в user.ini не излиза, и трябва да се пише паролата отново user.ini.Ако неможе да се оправи ,остава вторият варянт който предложи да се направи нов плъгин .

Потребителски аватар

mBFF-TheFucKBG CSNatioN
Потребител
Потребител
Мнения: 312
Регистриран: 09 ное 2018, 16:40
Местоположение: Сливен
Се отблагодари: 13 пъти
Получена благодарност: 11 пъти
Години: 15

Редактиране на Temporary Admin добяване на ник и парола

Мнение от mBFF-TheFucKBG CSNatioN » 15 юни 2019, 12:12

Не съм Скриптър,но мога някакви минимални неща.Добавих заместители и не съм го тествал,но може да го тестваш.
Заместителите са за паролата и за името.

Код: Избери всички

/* AMXMOD X script.
*
* Scripted by GHW.Chronic
*
*   v1.2 - Admin Automatically Gets Admin, No Name Changing Or Map Change To Get His Admin
*        - Permanent Admin Capabilities Added
*        - User's Name Is Added To The Users.ini File
*        - Temp-Admin Removal Is Logged
*
*   v1.0 - Initial Release
*
*/

#include <amxmodx>
#include <amxmisc>

new tempname[33][32]
new pass[128];
new szName, szPass

public plugin_init()
{
	register_plugin("Temporary Admin", "1.2", "GHW_Chronic")
        register_concmd("amx_tempadmin","amx_tempadmin",ADMIN_RCON," <NAME> <Days to have admin (0=infinate)> <Flags(find out flags in users.ini file)> <Password>")
	register_cvar("days","0")
	register_cvar("months","0")
	register_cvar("years","0")
	register_cvar("tempid","0")
	register_cvar("cvar_i_ta","0")
	register_cvar("flags","bcdefghijklmnopqrstu")
	set_task(5.0,"check_date",0)
	return PLUGIN_CONTINUE
}

public check_date()
{
	new todaysmonth[32]
	new todaysday[32]
	new todaysyear[32]
	get_time("%m",todaysmonth,31)
	get_time("%d",todaysday,31)
	get_time("%Y",todaysyear,31)
	new todaysdaynum = str_to_num(todaysday)
	new todaysmonthnum = str_to_num(todaysmonth)
	new todaysyearnum = str_to_num(todaysyear)
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)

	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users2.ini",configdir)

	new filelen1
	new filesays1[32]
	new i = get_cvar_num("cvar_i_ta")

	new configfile2[200]
	format(configfile2,199,"%s/users.ini",configdir)

	read_file(configfile1,i,filesays1,31,filelen1)
	new filesays3[200]
	format(filesays3,199,"%s",filesays1)
	new i2 = i + 1
	if(i>401)
	{
		set_cvar_num("cvar_i_ta",0)
		return PLUGIN_HANDLED
	}

	if(equal(filesays3,alltogether))
	{
		new filesays2[5]
		new txtLen
		read_file(configfile1,i2,filesays2,4,txtLen)
		new filesays5 = str_to_num(filesays2)

		write_file(configfile2,";Temp-Admin's Name Use To Be here. Do not remove this line unless it is the last line in the users.ini file.",filesays5)
		write_file(configfile1,";Old Date Use To Be Here.",i)
		new aaa = filesays5 - 1
		new aaaa[32]
		read_file(configfile2,aaa,aaaa,31,txtLen)
		new holder769[200]
		format(holder769,199,"say Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		log_amx("Temp-ViP ^"%s^"Has Been Removed From Administration.",aaaa)
		server_cmd(holder769)
	}
	set_cvar_num("cvar_i_ta",i2)
	set_task(0.0, "check_date")
	return PLUGIN_HANDLED
}

public amx_tempadmin(id,level,cid)
{
	if ( !cmd_access(id,level,cid,4) )
	{
		return PLUGIN_HANDLED
	}
	new arg1[63]
	new arg2[63]
	new arg3[63]
	new arg4[63]
	read_argv(1,arg1,63)
	read_argv(2,arg2,63)
	read_argv(3,arg3,63)
	read_argv(4,arg4,63)
	formatex(pass, charsmax(pass), "%s", read_argv(4,arg4,63));
	set_cvar_string("flags",arg3)
	new arg22 = str_to_num(arg2)
	new plist[32]
	new pnum
	get_players(plist,pnum,"c")
	new tempid2 = find_player("bl",arg1)
	set_cvar_num("tempid",tempid2)
	set_cvar_num("findays",arg22)
	new temp_connected = is_user_connected(tempid2)
	if(temp_connected==1)
	{
		if(str_to_num(arg2)==0 || str_to_num(arg2)>=900)
		{
			new instertintousers[200]
			new instertintousersname[200]
			get_user_name(tempid2,tempname[tempid2],31)
			//new tempsauthid[32]
			//get_user_authid(tempid2,tempsauthid,31)
			format(instertintousers,199,"^"%s^" ^"%s^" ^"%s^" ^"a^"", tempname[tempid2], arg4, arg3)
			new configdir[200]
			get_configsdir(configdir,199)
			new configfile1[200]
			format(configfile1,199,"%s/users.ini",configdir)
			write_file(configfile1,"",-1)
			format(instertintousersname,199,";%s",tempname[tempid2])
			write_file(configfile1,instertintousersname,-1)
			write_file(configfile1,instertintousers,-1)
			server_cmd("amx_reloadadmins")
			client_cmd(tempid2,"name PermanentAdmin")
			set_task(5.0,"changename",tempid2)
			console_print(id,"Permanent-Admin Has Been Added. He Now Has Admin.")
			return PLUGIN_HANDLED
		}
		set_cvar_num("tempid",tempid2)
		new todaysmonth[32]
		new todaysday[32]
		new todaysyear[32]
		get_time("%m",todaysmonth,31)
		get_time("%d",todaysday,31)
		get_time("%Y",todaysyear,31)
		new todaysdaynum = str_to_num(todaysday)
		new todaysmonthnum = str_to_num(todaysmonth)
		new todaysyearnum = str_to_num(todaysyear)
		new newday = todaysdaynum + arg22
		set_cvar_num("days",newday)
		set_cvar_num("months",todaysmonthnum)
		set_cvar_num("years",todaysyearnum)
		if(todaysmonthnum==1)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==2)
		{
			if(newday>28)
			{
				set_task(0.0, "february")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==3)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==4)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==5)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==6)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==7)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==8)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==9)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==10)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==11)
		{
			if(newday>30)
			{
				set_task(0.0, "thirty")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		if(todaysmonthnum==12)
		{
			if(newday>31)
			{
				set_task(0.0, "thirtyone")
				return PLUGIN_HANDLED
			}
			else
			{
				set_task(0.0, "makenewdate")
				return PLUGIN_HANDLED
			}
			return PLUGIN_HANDLED
		}
		return PLUGIN_HANDLED
	}
	else
	{
		console_print(id,"No Player With That Name Exists")
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public makenewdate()
{
	new endday = get_cvar_num("days")
	new endmonth = get_cvar_num("months")
	new endyear = get_cvar_num("years")
	new alltogether[200]
	format(alltogether,199,"m%dd%dy%d",endmonth,endday,endyear)
	new arg3[64]
	get_cvar_string("flags",arg3,63)
	new instertintousers[200]
	new instertintousersname[200]
	new tempsid2 = get_cvar_num("tempid")
	get_user_name(tempsid2,tempname[tempsid2],31)
	//new tempsauthid[32]
	//get_user_authid(tempsid2,tempsauthid,31)
	format(instertintousers,199,"^"%s^" ^"%s^" ^"%s^" ^"a^"", tempname[tempsid2], pass, arg3)
	new configdir[200]
	get_configsdir(configdir,199)
	new configfile1[200]
	format(configfile1,199,"%s/users.ini",configdir)
	write_file(configfile1,"",-1)
	format(instertintousersname,199,";%s",tempname[tempsid2])
	write_file(configfile1,instertintousersname,-1)
	write_file(configfile1,instertintousers,-1)
	new line = file_size(configfile1,1)
	new line2 = line - 2
	new line3[200]
	format(line3,199,"%d",line2)
	new configfile2[200]
	format(configfile2,199,"%s/users2.ini",configdir)
	write_file(configfile2,alltogether,-1)
	write_file(configfile2,line3,-1)
	server_cmd("amx_reloadadmins")
	client_cmd(tempsid2,"name %s", szName)
	set_task(5.0,"changename",tempsid2)
	console_print(0,"Temp-VIP Has Been Added. He Now Has VIP.")
	formatex(pass, charsmax(pass), "%s", szPass);
	return PLUGIN_HANDLED
}

public changename(id)
{
	new holder444[200]
	format(holder444,199,"name ^"%s^"",tempname[id])
	client_cmd(id,holder444)
	return PLUGIN_HANDLED
}
public thirtyone()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public thirty()
{
	new ndays = get_cvar_num("days")
	new nmonths = get_cvar_num("months")
	if(ndays>30)
	{
		new ndays2 = ndays - 30
		new nmonths2 = nmonths + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",nmonths2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public february()
{
	new ndays = get_cvar_num("days")
	if(ndays>28)
	{
		new ndays2 = ndays - 28
		set_cvar_num("days",ndays2)
		set_cvar_num("months",3)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public newyear()
{
	new ndays = get_cvar_num("days")
	new nyears = get_cvar_num("years")
	if(ndays>31)
	{
		new ndays2 = ndays - 31
		new nyears2 = nyears + 1
		set_cvar_num("days",ndays2)
		set_cvar_num("months",1)
		set_cvar_num("years",nyears2)
		set_task(0.0, "select_days")
	}
	else
	{
		set_task(0.0, "makenewdate")
	}
	return PLUGIN_HANDLED
}

public select_days()
{
	new nmonths = get_cvar_num("months")
	if(nmonths==1)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==2)
	{
		set_task(0.0, "february")
	}
	if(nmonths==3)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==4)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==5)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==6)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==7)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==8)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==9)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==10)
	{
		set_task(0.0, "thirtyone")
	}
	if(nmonths==11)
	{
		set_task(0.0, "thirty")
	}
	if(nmonths==12)
	{
		set_task(0.0, "newyear")
	}
	return PLUGIN_HANDLED
}
Фенче на СкандаУ <3

Потребителски аватар

JackEyedJones
Потребител
Потребител
Мнения: 241
Регистриран: 10 сеп 2018, 17:26
Местоположение: Plovdiv, Bulgaria, Europe, Entire World
Се отблагодари: 4 пъти
Получена благодарност: 39 пъти
Години: 26
Контакти:

Редактиране на Temporary Admin добяване на ник и парола

Мнение от JackEyedJones » 15 юни 2019, 12:30

Плъгина съм го ползвал преди много време, не го препоръчвам тъй като прецаква целия users.ini файл. При добавяне на админ с командата или през меню, ако си спомням правилно имаше такова, преебава файла. Ако нямате бекъп, може да се прецакате много яко.

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 0 госта