AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   adding a ini file in a plugin (https://forums.alliedmods.net/showthread.php?t=25300)

wonsae 03-11-2006 12:09

adding a ini file in a plugin
 
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.") }

Werewolf 03-11-2006 14:17

#include "file.ini"
There you go :lol:
I think it works.
Give me some info :wink:
Should you precache in it?

Brad 03-11-2006 15:41

What do you mean?

Do you want to precache all the models found in an INI file rather than hardcoding what models to precache?

wonsae 03-11-2006 23:02

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 03-15-2006 18:34

so can anyone help me?

Rixorster 03-16-2006 02:02

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


All times are GMT -4. The time now is 20:27.

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