Raised This Month: $ Target: $400
 0% 

adding a ini file in a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-11-2006 , 12:09   adding a ini file in a plugin
Reply With Quote #1

hi how would i add a ini file for models in this plugin

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Clothesmod" #define VERSION "1.0" #define AUTHOR "won" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     } public plugin_precache() {     precache_model("models/player/collector-civilian") } public client_connect(id) {     client_cmd(id,"model collector-civ") } public client_infochanged(id){     get_user_info(id,"model","newmodel")     engclient_cmd(id,"model","oldmodel");     client_print(id,print_chat,"[Clothesmod] You may not change clothes that way.") }
wonsae is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-11-2006 , 14:17  
Reply With Quote #2

#include "file.ini"
There you go
I think it works.
Give me some info
Should you precache in it?
Werewolf is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-11-2006 , 15:41  
Reply With Quote #3

What do you mean?

Do you want to precache all the models found in an INI file rather than hardcoding what models to precache?
Brad is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-11-2006 , 23:02  
Reply With Quote #4

Quote:
Originally Posted by Brad
What do you mean?

Do you want to precache all the models found in an INI file rather than hardcoding what models to precache?
yeah
wonsae is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-15-2006 , 18:34  
Reply With Quote #5

so can anyone help me?
wonsae is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-16-2006 , 02:02  
Reply With Quote #6

Code:
  public loadSettings() {     new szFilename[64]     get_cvar_string("clothes",szFilename,63)     if (!file_exists(szFilename)) {         write_file(szFilename,"; Clothes spawn here",-1)         server_print("[Clothes] No ^"%s^" was found, so it has been created.", szFilename)         return PLUGIN_HANDLED     } }
Code:
public plugin_init() {     register_cvar("clothes", "clothes.ini")     set_task(5.0,"loadSettings") }
figure out the saving yourself ;P
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
Reply


Thread Tools
Display Modes

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 20:27.


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