The problem: is reading only the first line, sorry, i'm noob at reading files, thank's for help:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
new const PLUGIN[] = "Block Pick UP by MODEL",
VERSION[] = "0.1",
AUTHOR[] = "Craxor";
new filename[256];
new g_Model[60];
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,255)
format(filename,255,"%s/blockpuw.ini",filename)
new filepointer = fopen(filename,"r")
if(filepointer)
{
new readdata[128];
while(fgets(filepointer,readdata,charsmax( readdata)))
{
parse(readdata,g_Model, charsmax( g_Model ))
formatex( buffer, charsmax( buffer ), "models/w_%s.mdl", g_Model);
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;
}
__________________