Cerere modificare plugin amx_revive

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
ursul panda
Membru, skill 0
Membru, skill 0
Posts: 57
Joined: 19 Jul 2017, 22:18
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Aug 2017, 11:30

Salutare prieteni, apelez din nou la voi ca nu ma pricep la modifcat pluginuri. Am acest plugin amx_revive.amxx , acest plugin are comanda amx_revive - <player/@/@T/@CT> <hp> <armor>. As vrea sa aiba acces doar cei cu imunitate adica fondatorii la aceasta comanda .

Sma --> CLICK
RoyalServer 2
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 1367
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

12 Aug 2017, 14:01

Aici se posteaza doar sursa cu ajutorul butonului Sursa=
register_concmd("amx_revive","revive_cmd",ADMIN_IMMUNITY,"- <player/@/@T/@CT> <hp> <armor>");
Doar ei au acces ( cei cu flagul a)
Image
ursul panda
Membru, skill 0
Membru, skill 0
Posts: 57
Joined: 19 Jul 2017, 22:18
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Aug 2017, 14:55

Nu inteleg... am modificat ce trebuie de ce are acces ownerul cu flagul "bcdefiujor" ?? Au acces mai multi.. eu vreau doar sa aiba cei cu imunitate.. sunt chiar asa de noob?
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 1367
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

12 Aug 2017, 15:13

incearca asa
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Ultimate Revive"
#define VERSION "1.1"
#define AUTHOR "anakin_cstrike"

#define ACCESS ADMIN_IMMUNITY

new g_fade;
public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR);
   register_concmd("amx_revive","revive_cmd",ACCESS,"- <player/@/@T/@CT> <hp> <armor>");
   g_fade = get_user_msgid("ScreenFade");
}
public revive_cmd(id,level,cid)
{
   if(!cmd_access(id,level,cid,4))

      return PLUGIN_HANDLED;
   new 
   arg[32],arg2[4],arg3[4],
   name[32],hp,armor;
   read_argv(1,arg,31);
   read_argv(2,arg2,3);
   read_argv(3,arg3,3);
   get_user_name(id,name,31);
   new argc = read_argc();
   if(argc < 2) {hp = 100;armor = 0;}
   else if(argc == 3) {hp = str_to_num(arg2);armor = 0;}
   else {hp = str_to_num(arg2);armor = str_to_num(arg3);}
   if(arg[0] == '@')
   {
      new players[32],teamname[24],tname[16],num,index,i;
      if(arg[1])
      {
         if(arg[1] == 'T')
         {
            copy(tname,15,"TERRORIST");
            copy(teamname,23,"Terrorist");
         } else if(arg[1] == 'C' && arg[2] == 'T') {
            copy(tname,15,"CT");
            copy(teamname,23,"Counter-Terrorist");
         } else {
            console_print(id,"Usage: @T/@CT");
            return PLUGIN_HANDLED;
         }
         get_players(players,num,"be",tname);
      } else {
         get_players(players,num);
         copy(teamname,23,"All");
      }
      if(num == 0)
      {
         console_print(id,"No players in team %s",teamname);
         return PLUGIN_HANDLED;
      }
      for(i = 0;i < num;i++)
      {
         index = players;
         if(is_user_alive(index)) continue;
         Revive(index,hp,armor);
      }
      log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
   } else {
      new target = cmd_target(id,arg,3);
      if(!target)
      return PLUGIN_HANDLED;
      if(is_user_alive(target))
      {
         console_print(id,"Player is allready alive !");
         return PLUGIN_HANDLED;
      }
      new namet[32]; 
      get_user_name(target,namet,31);
      Revive(target,hp,armor);
      log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
   }
   return PLUGIN_HANDLED;
}
Revive(index,hp,armor)
{
   set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
   set_pev(index,pev_iuser1,0);
   dllfunc(DLLFunc_Think,index);
   engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
   new array[3];
   array[0] = index;
   array[1] = hp;
   array[2] = armor
   set_task(0.5,"respawn",0,array,3);
}
public respawn(array[3])
{
   new index = array[0];
   new hp = array[1];
   new armor = array[2];
   if(is_user_connected(index))
   {
      dllfunc(DLLFunc_Spawn,index);
      set_pev(index,pev_health,float(hp));
      set_pev(index,pev_armorvalue,float(armor));
      Fade(index,0,255,0,30);
   }
}
stock Fade(index,red,green,blue,alpha)
{
   message_begin(MSG_ONE,g_fade,{0,0,0},index);
   write_short(1<<10);
   write_short(1<<10);
   write_short(1<<12);
   write_byte(red);
   write_byte(green);
   write_byte(blue);
   write_byte(alpha);
   message_end();
}
Image
ursul panda
Membru, skill 0
Membru, skill 0
Posts: 57
Joined: 19 Jul 2017, 22:18
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Aug 2017, 15:27

La fel.. tot au acces unii adminii fara imunitate
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 1367
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

12 Aug 2017, 15:35

Am testat eu

Code: Select all

] amx_revive
You have no access to that command
imunitatea este pe flagul a
Image
ursul panda
Membru, skill 0
Membru, skill 0
Posts: 57
Joined: 19 Jul 2017, 22:18
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Aug 2017, 15:56

Pai la mine tot nu merge... mi-am pus 3 accese diferite pe server si tot am acces la comanda.. :( Ce as putea face? :((

De exemplu eu am adaugat amx_exec, la acest plugin nu am treaba.. doar fondatorii au acces la el, ma gandeam daca se pot face aceleasi setari si pentru amx_revive.. gen sa bagati aceleasi setari ca la amx_exec.. doar o idee poate ar merge
| Afiseaza codul
// AMX client exec v0.3
// By v3x
// If you wish to use any of my code below, please credit me for it! Thanks.

#include <amxmodx>
#include <amxmisc>

// amx_show_activity <2|1|0>
// Look in amxx.cfg for more details

public plugin_init() {

	register_plugin("AMX Client Exec","0.03","v3x")
	register_clcmd("amx_exec","doExec",ADMIN_RCON,"<nick,@TEAM,*(all),@SERVER>")
	register_srvcmd("amx_exec","doExec")
}

new bool:isAll
new bool:isTeam
new bool:isServ
// For messages

public doExec(id,level,cid) 
{

	if(!cmd_access(id,level,cid,3)) 
	{
		return PLUGIN_HANDLED
	}

	new arg[32]
	new command[64]
	new players[32]
	new player,num,i

	read_argv(1,arg,31)
	read_argv(2,command,63)

	remove_quotes(command)
	
	while(replace(command,63,"\'","^"")) { } // Credited to OLO

	new activity = get_cvar_num("amx_show_activity")

	new admin[32]
	get_user_name(id,admin,31)

	if(arg[0]=='@') {

		if(equali(arg[1],"A") 
		|| equali(arg[1],"ALL")) 
		{
			isAll = true
			isTeam = false
			isServ = false
			get_players(players,num,"c")
		}
		
		if(equali(arg[1],"TERRORIST") 
		|| equali(arg[1],"T") 
		|| equali(arg[1],"TERROR") 
		|| equali(arg[1],"TE") 
		|| equali(arg[1],"TER")) 
		{
			isAll = false
			isTeam = true
			isServ = false
			get_players(players,num,"ce","TERRORIST")
		}
		
		if(equali(arg[1],"CT")
		|| equali(arg[1],"C") 
		|| equali(arg[1],"COUNTER")) 
		{
			isAll = false
			isTeam = true
			isServ = false
			get_players(players,num,"ce","CT")
		}
		
		if(equali(arg[1],"S") 
		|| equali(arg[1],"SERV") 
		|| equali(arg[1],"SERVER")) 
		{
			isAll = false
			isTeam = false
			isServ = true
			server_cmd(command)
		}
		
		if(!(num) && !(isServ)) 
		{
			console_print(id,"[AMXX] No players on such team!")
			return PLUGIN_HANDLED
		}

		if(!isServ) 
		{
			
			for(i=0;i<num;i++) 
			{

				player = players

				if(!is_user_connected(player)) continue
				
				else if(player) 
				{

					if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
					{
						client_cmd(player,command)
					}
				}
			}
		}

		if(isAll==true) 
		{

			switch(activity) 
			{

				case 1: 
				{
					client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone",command)
					server_print("ADMIN: Command line ^"%s^" has been used on everyone",command)
				}
				case 2: 
				{
					client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
					server_print("ADMIN %s: Command line ^"%s^" has been used on everyone",admin,command)
				}
			}
		}

		if(isTeam==true) 
		{

			switch(activity) 
			{

				case 1: 
				{
					client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
					server_print("ADMIN: Command line ^"%s^" has been used on the %ss",command,arg[1])
				}
				case 2: 
				{
					client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
					server_print("ADMIN %s: Command line ^"%s^" has been used on the %ss",admin,command,arg[1])
				}
			}
		}

		if(isServ==true) 
		{

			switch(activity) 
			{

				case 1: 
				{
					client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been exectuted into the server",command)
					server_print("ADMIN: Command line ^"%s^" has been exectuted into the server",command)
				}
				case 2: 
				{
					client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
					server_print("ADMIN %s: Command line ^"%s^" has been exectuted into the server",admin,command)
				}
			}
		}
	}

	else if(arg[0]=='*') 
	{

		get_players(players,num,"c")

		for(i=0;i<num;i++) 
		{

			player = players

			if(!is_user_connected(player)) continue

			else if(player) 
			{

				if(!(get_user_flags(player) & ADMIN_IMMUNITY)) 
				{
					client_cmd(player,command)
				}
			}
		}
		

		
		switch(activity) 
		{

			case 1: 
			{
				client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on everyone!",command)
				server_print("ADMIN: Command line ^"%s^" has been used on everyone!",command)
			}
			case 2: 
			{
				client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
				server_print("ADMIN %s: Command line ^"%s^" has been used on everyone!",admin,command)
			}
		}
	}

	else 
	{
		new target = cmd_target(id,arg,3)
		new name[33]

		if(!is_user_connected(target)) 
		{
			return PLUGIN_HANDLED
		}

		get_user_name(target,name,32)

		if(!(get_user_flags(target) & ADMIN_IMMUNITY)) 
		{
			client_cmd(target,command)
		}

		switch(activity) 
		{
			case 1: 
			{
				client_print(0,print_chat,"ADMIN: Command line ^"%s^" has been used on %s!",command,name)
				server_print("ADMIN: Command line ^"%s^" has been used on %s!",command,name)
			}
			case 2: 
			{
				client_print(0,print_chat,"ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
				server_print("ADMIN %s: Command line ^"%s^" has been used on %s!",admin,command,name)
			}
		}
	}

	return PLUGIN_HANDLED
}
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3850
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: 76561198063679589
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 595 times
Contact:

12 Aug 2017, 20:59

Modifica linia necesară din „../configs/cmdaccess.ini”
SAU, îți las mai jos plg modificat direct. Nu am stat să „optimizez” codul..
REVIVE | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define CMD_ACCESS	"ADMIN_RCON"

#define PLUGIN "Ultimate Revive"
#define VERSION "1.1"
#define AUTHOR "anakin_cstrike"

new g_fade;
public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR);
   register_concmd("amx_revive","revive_cmd",-1,"- <player/@/@T/@CT> <hp> <armor>");
   g_fade = get_user_msgid("ScreenFade");
}
public revive_cmd(id)
{
   if(!(get_user_flags(id)&read_flags(CMD_ACCESS)))	return	console_print(id,"[AMXX] Nu ai acces la 'amx_revive'")
   new 
   arg[32],arg2[4],arg3[4],
   name[32],hp,armor;
   read_argv(1,arg,31);
   if(equal(arg,""))	return	console_print(id,"[AMXX] Folosire corecta -> 'amx_revive <player/@/@T/@CT> <hp> <armor>'")
   read_argv(2,arg2,3);
   read_argv(3,arg3,3);
   get_user_name(id,name,31);
   new argc = read_argc();
   if(argc < 2) {hp = 100;armor = 0;}
   else if(argc == 3) {hp = str_to_num(arg2);armor = 0;}
   else {hp = str_to_num(arg2);armor = str_to_num(arg3);}
   if(arg[0] == '@')
   {
      new players[32],teamname[24],tname[16],num,index,i;
      if(arg[1])
      {
         if(arg[1] == 'T')
         {
            copy(tname,15,"TERRORIST");
            copy(teamname,23,"Terrorist");
         } else if(arg[1] == 'C' && arg[2] == 'T') {
            copy(tname,15,"CT");
            copy(teamname,23,"Counter-Terrorist");
         } else {
            console_print(id,"Usage: @T/@CT");
            return PLUGIN_HANDLED;
         }
         get_players(players,num,"be",tname);
      } else {
         get_players(players,num);
         copy(teamname,23,"All");
      }
      if(num == 0)
      {
         console_print(id,"No players in team %s",teamname);
         return PLUGIN_HANDLED;
      }
      for(i = 0;i < num;i++)
      {
         index = players;
         if(is_user_alive(index)) continue;
         Revive(index,hp,armor);
      }
      log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
   } else {
      new target = cmd_target(id,arg,3);
      if(!target)
      return PLUGIN_HANDLED;
      if(is_user_alive(target))
      {
         console_print(id,"Player is allready alive !");
         return PLUGIN_HANDLED;
      }
      new namet[32]; 
      get_user_name(target,namet,31);
      Revive(target,hp,armor);
      log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
   }
   return PLUGIN_HANDLED;
}
Revive(index,hp,armor)
{
   set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
   set_pev(index,pev_iuser1,0);
   dllfunc(DLLFunc_Think,index);
   engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
   new array[3];
   array[0] = index;
   array[1] = hp;
   array[2] = armor
   set_task(0.5,"respawn",0,array,3);
}
public respawn(array[3])
{
   new index = array[0];
   new hp = array[1];
   new armor = array[2];
   if(is_user_connected(index))
   {
      dllfunc(DLLFunc_Spawn,index);
      set_pev(index,pev_health,float(hp));
      set_pev(index,pev_armorvalue,float(armor));
      Fade(index,0,255,0,30);
   }
}
stock Fade(index,red,green,blue,alpha)
{
   message_begin(MSG_ONE,g_fade,{0,0,0},index);
   write_short(1<<10);
   write_short(1<<10);
   write_short(1<<12);
   write_byte(red);
   write_byte(green);
   write_byte(blue);
   write_byte(alpha);
   message_end();
}
Nu îmi mai trimiteți PM pe forum! Nu merge să răspund
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
ursul panda
Membru, skill 0
Membru, skill 0
Posts: 57
Joined: 19 Jul 2017, 22:18
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

12 Aug 2017, 21:20

Multumesc mult Adryyy ms ms !!! ms mult din inima
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests