Raised This Month: $ Target: $400
 0% 

Help with strbreak


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 12-28-2018 , 04:19   Help with strbreak
Reply With Quote #1

Code:
#include < amxmodx >
#include < amxmisc >

#define PLUGIN	"Report System"
#define VERSION	"1.0"
#define AUTHOR	"LondoN eXtream"

public plugin_init ( )
{
	register_plugin ( PLUGIN, VERSION, AUTHOR );

	register_clcmd ( "say", "Func_ChatCMD" );
	register_clcmd ( "say_team", "Func_ChatCMD" );

	set_task ( random_float ( 47.5, 126.5 ), "ShowInfo", .flags="b" );
}

public ShowInfo ( )	Print ( 0, "^x04[Zombie OutStanding]^x01 Scrie^x03 /report <nume> <motiv>^x01 pentru a raporta un jucator care profita de server!" );

public Func_ChatCMD ( Player )
{
	new ChatSays [ 256 ], User [ 32 ], Reason [ 32 ];
	read_args ( ChatSays, charsmax ( ChatSays ) );
	remove_quotes ( ChatSays );

	strbreak ( ChatSays, User, charsmax ( User ), Reason, charsmax ( Reason ) );

	if ( equal ( ChatSays, "/report" ) )
	{
		new Configs [ 128 ], Date [ 16 ];
		get_configsdir ( Configs, charsmax ( Configs ) );
		get_time ( "%d-%m", Date, charsmax ( Date ) );
		formatex ( Configs, charsmax ( Configs ), "%s/reports/reported-%s", Configs, Date );

		new Target = cmd_target ( Player, User, 8 );

		if  ( !Target )
			return;

		new Name [ 32 ], IP [ 32 ], szLine [ 258 ];
		get_user_name ( Target, Name, charsmax ( Name ) );
		get_user_ip ( Target, IP, charsmax ( IP ), 1 );
	
		formatex ( szLine, charsmax ( szLine ), "Jucatorul %s [IP: %s] a fost raportat pentru %s", Name, IP, Reason );
		write_file ( Configs, szLine );

		Print ( Player, "^x04[Zombie OutStanding]^x01 Iti multumim pentru raportul facut. Acesta va fi analizat in cel mai scurt timp" );
	}
}

stock Print(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); {
		for(new i = 0; i < count; i++) {
			if(is_user_connected(players[i])) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}
i've maked a simple report sistem.
command must be /report <user> <reason> then write the file from reports folder.
but doesn't work, i don't know why...if i strbreak with 3 args can't compile.
any ideas?
__________________
LondoN is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode