Raised This Month: $ Target: $400
 0% 

Problem about read file and set someting?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 06-27-2009 , 13:30   Re: Problem about read file and set someting?
Reply With Quote #6

Quote:
Originally Posted by K.K.Lv View Post
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(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Spawn"player""set_model")
 
get_configsdir(configsdir63)
 
format(configsdir63"%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
(idname31)
 
 new 
line 0
 
while(!read_file(configsdirline++, 127txtlen)) {
  
parse(configsdirparsedname31parsedmodels31)
  if (
equal(nameparsedname) {
   if (
get_user_flags(id) & ADMIN_KICK) {
    
cs_set_user_model(idparsedmodels)
    break
   }
  }
 }

Im not familiar with reading files but shouldnt you read the file before you try to use it?
micke1101 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 15:39.


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