Errori la compilare

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

06 Dec 2013, 12:25

Vreau sa fac un plugin in care sa inregistreze toate comenzile ilegale dintrun fisier .ini (si autamat sa le inregistreze in register_clcmd apoi sa foloseaza functa mea de block, "BlockCmd" , ) am gasit o parte a scriptului dar numi iese la compilare daca ma poate ajuta cineva , va multumesc !
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

new const PLUGIN [] = "Block Management";
new const VERSION [] = "1.0";
new const AUTHOR [] = "LordOfNothing aka AndreiCS";

// Tag Msg !

#define TAG "[eXtreamCS] Aceasta comanda este blocata !"


public plugin_init()
{
	
	/*	Plugin Info :	*/
	register_plugin(PLUGIN,VERSION,AUTHOR)
	
	/*	Block it 	*/
	
	new blockwords = readfile("addons/amxmodx/configs/blocked_commands.ini");
	register_clcmd(blockwords, "BlockCmd");
	
}


public BlockCmd(id)
{
	client_print(id, print_center, "%s",TAG);
	client_print(id, print_console, "%s",TAG);
	return PLUGIN_HANDLED
}

readfile(const filename[]) 
{ 
	new file[64]; 
	get_configsdir(file, sizeof (file)); 
	format(file, sizeof (file), "%s/yourfilename.ini", file); 

	if (!file_exists(file)) 
	{ 
		return PLUGIN_HANDLED; 
	} 

	new sz = file_size(file, 1); 

	for (new i; i < sz; i++) 
	{ 
	// i(post-increment) = number of current reading line; 
	new text[128]; 
	new ln; 
	
	read_file(file, i, text, sizeof (text), ln); 
	
	if (!ln || (text[0] == ';') || (text[0] == '/')) // line as comment or empty; 
	{ 
		continue; 
	} 
	
	new param1[32]; 
	new param2[32]; 
	new param3[32]; 
	
	parse(file, param1, sizeof (param1), param2, sizeof (param2), param3, sizeof (param3)); 
	
	} 
}
Rapidserver
User avatar
YONTU
Moderator ajutator
Moderator ajutator
Posts: 2446
Joined: 10 May 2013, 13:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 255 times
Been thanked: 281 times
Contact:

06 Dec 2013, 13:26

LordOfNothing wrote:Vreau sa fac un plugin in care sa inregistreze toate comenzile ilegale dintrun fisier .ini (si autamat sa le inregistreze in register_clcmd apoi sa foloseaza functa mea de block, "BlockCmd" , ) am gasit o parte a scriptului dar numi iese la compilare daca ma poate ajuta cineva , va multumesc !
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

new const PLUGIN [] = "Block Management";
new const VERSION [] = "1.0";
new const AUTHOR [] = "LordOfNothing aka AndreiCS";

// Tag Msg !

#define TAG "[eXtreamCS] Aceasta comanda este blocata !"


public plugin_init()
{
	
	/*	Plugin Info :	*/
	register_plugin(PLUGIN,VERSION,AUTHOR)
	
	/*	Block it 	*/
	
	new blockwords = readfile("addons/amxmodx/configs/blocked_commands.ini");
	register_clcmd(blockwords, "BlockCmd");
	
}


public BlockCmd(id)
{
	client_print(id, print_center, "%s",TAG);
	client_print(id, print_console, "%s",TAG);
	return PLUGIN_HANDLED
}

readfile(const filename[]) 
{ 
	new file[64]; 
	get_configsdir(file, sizeof (file)); 
	format(file, sizeof (file), "%s/yourfilename.ini", file); 

	if (!file_exists(file)) 
	{ 
		return PLUGIN_HANDLED; 
	} 

	new sz = file_size(file, 1); 

	for (new i; i < sz; i++) 
	{ 
	// i(post-increment) = number of current reading line; 
	new text[128]; 
	new ln; 
	
	read_file(file, i, text, sizeof (text), ln); 
	
	if (!ln || (text[0] == ';') || (text[0] == '/')) // line as comment or empty; 
	{ 
		continue; 
	} 
	
	new param1[32]; 
	new param2[32]; 
	new param3[32]; 
	
	parse(file, param1, sizeof (param1), param2, sizeof (param2), param3, sizeof (param3)); 
	
	} 
}

Code: Select all

    register_clcmd( blockwords, "BlockCmd"); 
-->

Code: Select all

    register_clcmd( "blockwords", "BlockCmd" ); 
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș

discord: IonutC#5114

Vrei sa joci pe un server de biohazard clasic specific timpurilor 2008-2012?
CLICK | Afiseaza codul
89.44.246.14:27015 biohazard clasic
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

06 Dec 2013, 19:38

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

new const PLUGIN [] = "Block Management";
new const VERSION [] = "1.0";
new const AUTHOR [] = "LordOfNothing aka AndreiCS";

// Tag Msg !

#define TAG "[eXtreamCS] Aceasta comanda este blocata !"


public plugin_init()
{
	
	/*	Plugin Info :	*/
	register_plugin(PLUGIN,VERSION,AUTHOR)
	
	/*	Block it 	*/
	
	new blockwords = readfile("addons/amxmodx/configs/blocked_commands.ini");
	register_clcmd("blockwords", "BlockCmd");
	
}


public BlockCmd(id)
{
	client_print(id, print_center, "%s",TAG);
	client_print(id, print_console, "%s",TAG);
	return PLUGIN_HANDLED
}

readfile(const filename[]) 
{ 
	new file[64]; 
	get_configsdir(file, sizeof (file)); 
	format(file, sizeof (file), "%s/yourfilename.ini", file); 

	if (!file_exists(file)) 
	{ 
		return PLUGIN_HANDLED; 
	} 

	new sz = file_size(file, 1); 

	for (new i; i < sz; i++) 
	{ 
	// i(post-increment) = number of current reading line; 
	new text[128]; 
	new ln; 
	
	read_file(file, i, text, sizeof (text), ln); 
	
	if (!ln || (text[0] == ';') || (text[0] == '/')) // line as comment or empty; 
	{ 
		continue; 
	} 
	
	new param1[32]; 
	new param2[32]; 
	new param3[32]; 
	
	parse(file, param1, sizeof (param1), param2, sizeof (param2), param3, sizeof (param3)); 
	
	}
	return PLUGIN_HANDLED;
}
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

07 Dec 2013, 08:35

"blockwords" este o variabile nu trebuie pus in ghilimele ca nu mai are niciun effect :))
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

07 Dec 2013, 11:41

Aaa acum am inteles ce vrei tu :))
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

07 Dec 2013, 13:22

Rezolvat ,dati TC
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 12:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 305 times
Been thanked: 320 times
Contact:

09 Jan 2014, 15:00

Mutat @Modificari pluginuri

PS :[/b] Postati in categoria potrivita - "Modificari necesare ale pluginurilor".

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests