 |
|
Veteran Member
Join Date: Jan 2008
Location: Banned-town
|

06-27-2009
, 13:30
Re: Problem about read file and set someting?
|
#6
|
Quote:
Originally Posted by K.K.Lv
can i do like this ?
PHP Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "Set Player Model" #define VERSION "1.0" #define AUTHOR "K.K.Lv"
new configsdir[64] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "set_model") get_configsdir(configsdir, 63) format(configsdir, 63, "%s/plmodels.ini", configsdir) } public plugin_precache() { precache_model("models/player/admin_ct/admin_ct.mdl") precache_model("models/player/admin_te/admin_te.mdl") } public set_model(id) { new name[32], parsedmodels[32], readdata[128], parsedname[32] new txtlen get_user_name(id, name, 31) new line = 0 while(!read_file(configsdir, line++, 127, txtlen)) { parse(configsdir, parsedname, 31, parsedmodels, 31) if (equal(name, parsedname) { if (get_user_flags(id) & ADMIN_KICK) { cs_set_user_model(id, parsedmodels) break } } } }
|
Im not familiar with reading files but shouldnt you read the file before you try to use it?
|
|
|
|