Raised This Month: $ Target: $400
 0% 

Help about Reading from file strings.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-28-2016 , 01:18   Re: Help about Reading from file strings.
Reply With Quote #3

Is acting the same, reading only first line:

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

new const PLUGIN[]	= "Blocking Pick UP Weapon",
	 VERSION[]	= "0.1",
	  AUTHOR[]	= "Craxor";

new filename[256];
new buffer[60];

public plugin_init( )
{
	register_plugin
	(
		.plugin_name = PLUGIN, 
		.version     = VERSION, 
		.author      = AUTHOR
	)

	register_forward( FM_Touch, "WeaponBk" );
}

public plugin_cfg( )
{
	get_configsdir( filename, charsmax( filename ) )
	format( filename, charsmax( filename ), "%s/blockpuw.ini", filename )

 
	new filepointer = fopen( filename, "r" )

	if( filepointer )
	{
		new readdata[128], parsemodel[32];

		while( !feof( filepointer) )
		{
			fgets( filepointer,readdata,charsmax( readdata) )
			parse( readdata, parsemodel, charsmax( parsemodel ) )
			formatex( buffer, charsmax( buffer ), "models/w_%s.mdl", parsemodel );
			break;
		}
     
		fclose( filepointer )
	}
}
 
public WeaponBk( Entity, Id )
{
	if ( !pev_valid( Entity ) || !pev_valid( Id ) || !is_user_alive( Id ) )
		return FMRES_IGNORED;

        new Model[32];
        pev(Entity, pev_model, Model, charsmax( Model ) );

	if( equali ( Model, buffer ) )
		return FMRES_SUPERCEDE;	

	return FMRES_IGNORED;
}
__________________
Project: Among Us

Last edited by Craxor; 01-28-2016 at 01:49.
Craxor is offline
Send a message via ICQ to Craxor
 



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 09:21.


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