Modificare plugin (amx_toggleimmune)

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

28 Aug 2010, 23:08

As dori si eu daca poate cinva sa modifice acest plugin astfel incat comenzile amx_immuneoff/on sa nu mai fie pa ADMIN_RCON adica flagul L, le vreau puse pe flagul K (ADMIN_PASSWORD) parca era

Acesta este pluginul
| Afiseaza codul
[code]//Includes
#include <amxmodx>
#include <amxmisc>

//Defines
#define CS_TEAM_T 1
#define CS_TEAM_CT 2
#define ADMIN_LEVEL ADMIN_RCON

public plugin_init()
	{
	// Plugin Info.
	register_plugin("AMX Toggle Immunity","3.12","slmclarengt")
	
	//Commands
	register_concmd("amx_immuneoff","ImmunityOff",ADMIN_RCON,"<name | #userid> - removes immunity on specified player")
	register_concmd("amx_immuneon","ImmunityOn",ADMIN_RCON,"<name | #userid> - adds immunity for specified player")
	register_concmd("amx_globalimmuneoff", "GlobalOff", ADMIN_RCON, "Turns immunity off of everyone w/ immunity")
	register_concmd("amx_globalimmuneon", "GlobalOn", ADMIN_RCON, "Turns immunity on for everyone authorized")
	register_concmd("amx_teamimmuneoff", "ImmuneOffTeam", ADMIN_RCON, "< 1 for T, 2 for CT > - turns specified Team's immunity off")
	register_concmd("amx_teamimmuneon", "ImmuneOnTeam", ADMIN_RCON, "< 1 for T, 2 for CT > - turns specified Team's immunity on")
	
	// Cvars
	register_cvar("sv_allowignore","1")
	register_cvar("disclude_self", "1") // discludes self from immunity off
}
//Variables
// variable to store whether user authorized for immunity back
new g_MakeSure[80]

public ImmunityOff(id, level, cid)
	{
	
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	if(get_cvar_num("sv_allowignore") == 0)
		{
		client_print(id,print_chat,"Server does not allow Immunity Off")
		return PLUGIN_HANDLED
	}
	else if(get_cvar_num("sv_allowignore") == 1)
		{
		new arg[32],name[32]
		read_argv(1,arg,31)
		new player = cmd_target(id,arg,8)
		get_user_name(player,name,31)
		if (!player)
			{
			client_print(id,print_chat,"Player %s could not be found",name)
			return PLUGIN_HANDLED
		}
		client_print(id,print_chat,"Player %s has been found",name)
		if(!(get_user_flags(player)&(1<<0))) // no immunity check
			{
			client_print(id,print_chat,"Player %s does not have immunity",name)
			g_MakeSure[player] =  0
			return PLUGIN_HANDLED
		}
		remove_user_flags(player,(1<<0),0) // take their immunity away
		client_print(id,print_chat,"Player %s has lost immunity",name)
		g_MakeSure[player] = 1 // store the player that they deserve immunity
	}
	return PLUGIN_HANDLED
}

public ImmunityOn(id, level, cid)
	{
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	
	if(get_cvar_num("sv_allowignore") == 0)
		{
		client_print(id,print_chat,"Server does not allow immunity on")
		return PLUGIN_HANDLED
	}
	else if(get_cvar_num("sv_allowignore") == 1)
		{
		
		new arg[32],name[32]
		read_argv(1,arg,31)
		new player = cmd_target(id,arg,8)
		get_user_name(player,name,31)
		if (!player)
			{
			client_print(id,print_chat,"Player %s could not be found",name)
			return PLUGIN_HANDLED
		}
		client_print(id,print_chat,"Player %s has been found",name)
		if(!(get_user_flags(player)&(1<<0))) // check for immune authorization
			{
			if(!g_MakeSure[player])
				{
				client_print(id,print_chat,"Player %s is not authorized to have immunity",name)
				return PLUGIN_HANDLED
			}
			set_user_flags(player,(1<<0),0) // give them immunity back
			client_print(id,print_chat,"Player %s has been given his/her immunity back",name)
			return PLUGIN_HANDLED
		}
	}
	return PLUGIN_HANDLED
}

public GlobalOn(id, level, cid)
	{
	if(get_cvar_num("sv_allowignore") == 1)
		{
		if(!cmd_access(id,level,cid,1)) 
			return PLUGIN_HANDLED
		new players[32], nums
		get_players(players, nums, "c")
		for(new k = 0; k < nums; k++)
			{
			if(g_MakeSure[k] == 1)
				{
				set_user_flags(players[k],(1<<0),0)
				new name[32]
				get_user_name(players[k],name,31)
				client_print(id,print_chat,"Player %s^'s immunity has been restored",name)
				g_MakeSure[k] = 0
			}
		}
	}
	return PLUGIN_HANDLED
}

public GlobalOff(id, level, cid)
	{
	if(get_cvar_num("sv_allowignore") == 1)
		{
		if(!cmd_access(id,level,cid,1)) 
			return PLUGIN_HANDLED
		new players[32], nums
		get_players(players, nums, "c")
		for(new k = 0; k < nums; k++)
			{
			if((get_user_flags(players[k])&(1<<0)))
				{
				if((get_cvar_num("disclude_self") == 1) && (players[k] == id)){}
				g_MakeSure[k] = 1
				remove_user_flags(players[k],(1<<0),0)
				new name[32]
				get_user_name(players[k],name,31)
				client_print(id,print_chat,"Player %s has lost immunity",name)
			}
		}
	}
	return PLUGIN_HANDLED
}


//Mainly from VotorX's Version
public ImmuneOffTeam(id, level, cid)
	{
	if(get_cvar_num("sv_allowignore") == 1)
		{
		if(!cmd_access(id,level,cid,1)) 
			return PLUGIN_HANDLED
		new players[32], nums, team[32]
		read_argv(1,team,31)
		team = ("%s", team)
		get_players(players, nums, "ce", team)
		for(new k = 0; k < nums; k++)
			{
			if((get_user_flags(players[k])&(1<<0)))
				{
				if((get_cvar_num("disclude_self") == 1) && (players[k] == id)){}
				g_MakeSure[k] = 1
				remove_user_flags(players[k],(1<<0),0)
				new name[32]
				get_user_name(players[k],name,31)
				client_print(id,print_chat,"Player %s has lost immunity",name)
			}
		}
	}
	return PLUGIN_HANDLED
}
//Mainly from VotorX's Version
public ImmuneOnTeam(id, level, cid)
	{
	if(get_cvar_num("sv_allowignore") == 1)
		{
		if(!cmd_access(id,level,cid,1)) 
			return PLUGIN_HANDLED
		new players[32], nums, team[32]
		read_argv(1,team,31)		
		team = ("%s", team)
		get_players(players, nums, "ce", team)
		for(new k = 0; k < nums; k++)
			{
			if(g_MakeSure[k] == 1)
				{
				set_user_flags(players[k],(1<<0),0)
				new name[32]
				get_user_name(players[k],name,31)
				client_print(id,print_chat,"Player %s^'s immunity has been restored",name)
				g_MakeSure[k] = 0
			}
		}
	}
	return PLUGIN_HANDLED
}

public client_disconnect(id)
	{
	if(g_MakeSure[id])
		set_user_flags(id,(1<<0),0) // set immune back if they are authorized
	g_MakeSure[id] = 0 // set back to 0 because they have it back.
	return PLUGIN_HANDLED
}


public plugin_end()
	{
	for(new i = 0; i < get_maxplayers(); i++)
		if(g_MakeSure)
		set_user_flags(i,(1<<0),0) // set it back if authorized
	return PLUGIN_HANDLED
}

/* 
public GlobalOff(id, level, cid) Slmclarengt
{
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	if(get_cvar_num("sv_allowignore") == 0)
		{
		client_print(id,print_chat,"Server does not allow Immunity Off")
		return PLUGIN_HANDLED
	}
	for(new i = 0; i < get_playersnum(); i++)
		{
		if (get_user_flags(i) && (1<<0))
			{
			if((get_cvar_num("disclude_self") == 1) && i == id) {} // don't remove immune
			ImmunityOff(id, level, cid)
			client_print(id, print_chat, "Immunity has been removed from specified user(s)")
			g_MakeSure = 1 // store the player that they deserve immunity
		}
		else 
		continue;
	}
	return PLUGIN_HANDLED
} 
*/

/* 	
public GlobalOn(id, level, cid) Slmclarengt
{
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	for(new i = 0; i < get_playersnum(); i++)
		{
		new name[32] 
		get_user_name(i, name, 31)
		if(g_MakeSure == 1)
			{
			if(get_cvar_num("disclude_self") == 1 && i == id){} // don't give immune
			ImmunityOn(id, level, cid)
			client_print(id, print_chat, "Immunity has been given to specified user(s)")
			g_MakeSure = 0 // store the player that they have immunity
		}
	}
	return PLUGIN_HANDLED
}
*/

/* public GlobalOn(id, level, cid) VotorX
{
	new players[32], nums		
	get_players(players, nums, "ce")
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	if(get_cvar_num("sv_allowignore") == 0)
		{
		client_print(id,print_chat,"Server does not allow Immunity Off")
		return PLUGIN_HANDLED
	}
	else if(get_cvar_num("sv_allowignore") == 1)
		{
		for(new i = 0; i < get_playersnum(); i++) // through list of players
			{
			new name[32] 
			get_user_name(players, name, 31)
			if(g_MakeSure == 1) // check if they deserve immunity
				{
				set_user_flags(players, (1<<0), 0) // give them immunity back
				client_print(id, print_chat, "Successfully restored %s^'s immunity!", name)
				g_MakeSure = 0 // store the player that they have immunity
			}
		}
	}
	return PLUGIN_HANDLED
}*/

/* public GlobalOff(id, level, cid) VotorX
{
	new players[32], nums		
	get_players(players, nums, "ce")
	if (!cmd_access(id,level,cid,1)) // access?
		return PLUGIN_HANDLED
	if(get_cvar_num("sv_allowignore") == 0)
		{
		client_print(id,print_chat,"Server does not allow Immunity Off")
		return PLUGIN_HANDLED
	}
	else if(get_cvar_num("sv_allowignore") == 1)
		{
		for(new i = 0; i < get_playersnum(); i++)
			{
			if(get_cvar_num("disclude_self") == 1 && players == id){}
			new name[32] 
			get_user_name(players, name, 31)
			if(get_user_flags(players[i]) && (1<<0))
				{
				remove_user_flags(players[i], (1<<0), 0)
				client_print(id, print_chat, "Removed %s^'s immunity", name)
				g_MakeSure[i] = 1 // store the player that they deserve immunity
			}
		}		
	}
	return PLUGIN_HANDLED
}*/
[/code]

Multumesc anticipat
Last edited by Ciprian on 29 Aug 2010, 10:50, edited 1 time in total.
Reason: Foloseste sursa in loc de code/quote pt. texte lungi.
d@nuTz
Membru, skill +2
Membru, skill +2
Posts: 695
Joined: 20 May 2008, 08:49
Detinator Steam: Da
CS Status: Always first.
Detinator server CS: CS.Ecila.Ro
SteamID: blacklife4cs
Reputatie: Membru Club eXtreamCS (o luna)
Location: Home
Has thanked: 63 times
Been thanked: 39 times

29 Aug 2010, 09:25

Un topic nu`ti ajunge? Un moderator sa mute topicul la cos.
Image
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

29 Aug 2010, 10:41

mda din greseala

asa se intampla daca ai net de la rds si dai click de 2 ori pe Submit :D

Dar un raspuns cv se poate?
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

29 Aug 2010, 10:51

Modifica

Code: Select all

#define ADMIN_LEVEL ADMIN_RCON
in

Code: Select all

#define ADMIN_LEVEL ADMIN_PASSWORD
Recompilezi si restartezi serverul.
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

29 Aug 2010, 11:06

pai da am facut si eu asta dar eu vreau doar astea 2 sa fie pe admin_password

Code: Select all

register_concmd("amx_immuneoff","ImmunityOff",ADMIN_RCON,"<name | #userid> - removes immunity on specified player")
   register_concmd("amx_immuneon","ImmunityOn",ADMIN_RCON,"<name | #userid> - adds immunity for specified player")
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

29 Aug 2010, 11:53

niku-leonard wrote:pai da am facut si eu asta dar eu vreau doar astea 2 sa fie pe admin_password

Code: Select all

register_concmd("amx_immuneoff","ImmunityOff",ADMIN_RCON,"<name | #userid> - removes immunity on specified player")
   register_concmd("amx_immuneon","ImmunityOn",ADMIN_RCON,"<name | #userid> - adds immunity for specified player")
Pai inlocuieste ADMIN_RCON cu ADMIN_PASSWORD si recompileaza.
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

29 Aug 2010, 13:24

am incercat acum

nici un rezultat

Comanda o ia tot pe rcon :(
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

30 Aug 2010, 15:34

niku-leonard wrote:am incercat acum

nici un rezultat

Comanda o ia tot pe rcon :(
Daca inlocuiesti peste tot ADMIN_RCON cu ADMIN_PASSWORD si recompilezi nu are cum sa nu mearga. :-j
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

31 Aug 2010, 07:47

da ma am inteles asta.. stiu

dar eu nu vreau sa le modific pe toate

vreau doar astea doua

Code: Select all

 //Commands
   register_concmd("amx_immuneoff","ImmunityOff",ADMIN_RCON,"<name | #userid> - removes immunity on specified player")
   register_concmd("amx_immuneon","ImmunityOn",ADMIN_RCON,"<name | #userid> - adds immunity for specified player")
Uite cum am incercat eu:

Code: Select all

//Defines
#define CS_TEAM_T 1
#define CS_TEAM_CT 2
#define ADMIN_LEVEL ADMIN_RCON
#define ADMIN_LEVEL ADMIN_PASSWORD


public plugin_init()
   {
   // Plugin Info.
   register_plugin("AMX Toggle Immunity","3.12","slmclarengt")
   
   //Commands
   register_concmd("amx_immuneoff","ImmunityOff",ADMIN_PASSWORD,"<name | #userid> - removes immunity on specified player")
   register_concmd("amx_immuneon","ImmunityOn",ADMIN_PASSWORD,"<name | #userid> - adds immunity for specified player")
Iar la celelalte comenzi nu am unblat

Dar cand pun pluginul pe server DEGEABA.. tot la fel ia comanda tot de pe RCON

Mai trebuie modificat ceva inafara de aia?
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

31 Aug 2010, 10:40

Sterge

Code: Select all

#define ADMIN_LEVEL ADMIN_RCON
din sursa si incearca din nou.
User avatar
niku-leonard
Membru, skill 0
Membru, skill 0
Posts: 97
Joined: 23 Jul 2010, 02:18
Detinator Steam: Da
Detinator server CS: csgo.darkarena.ro
SteamID: STEAM_0:1:41693762
Has thanked: 4 times
Been thanked: 2 times
Contact:

31 Aug 2010, 11:49

daca sterg aia mai merg celelalte? (amx_globalimmune .. etc)?
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

31 Aug 2010, 11:56

niku-leonard wrote:daca sterg aia mai merg celelalte? (amx_globalimmune .. etc)?
Da, mai merg .
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests