AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   File functions. (https://forums.alliedmods.net/showthread.php?t=29288)

mysticssjgoku4 06-02-2006 15:09

File functions.
 
Alright, I've decided to give up some old habits and use .ini files for certain things.

Now, I have a few questions to ask because I'm more of an SQL experienced person rather than file function experienced.

I've tried to go through the function list at the FUNCWIKI but it's all so....confusing is the word?

But anyhow, I was wondering if someone could give me an example so I could perhaps understand a bit better and build off of it.

::::::::::::::::::::::::::::::::
Alright, now I've coded a simple plugin to manage bots on my fathers server.

The thing is, I want to be able to load different settings per map, but I want them stored in a file so that it is easy for him to edit.

The mod I'm using is Valve, which makes not a difference, but this is some extra information.

Now, I have the map "crossfire"

I want to store settings with tags above the list of settings I want used for that map.

Example:
Map "datacore" is loaded

AMXX reads from the bot_config.ini and looks for the tag "[datacore]"
and below that, there are settings like

Quote:

[datacore]
mp_timelimit "30"
addbot gman newbie 2
addbot scientist player 3

[crossfire]
mp_timelimit "25"
addbot gina ownage 1
addbot gordon player 5
I've seen people use files before in other plugins, but I figured if I asked for a quick and simple example, I could use that.

Again, thanks for anyone who helps, it's much appreciated.

-RW

SweatyBanana 06-02-2006 15:20

in your maps folder, make files named the same as the map with the extension .cfg


So if you were to play de_dust, it would be de_dust.cfg

mysticssjgoku4 06-02-2006 15:27

But I want it coded as a plugin.
The thing is, if a map doesnt have a .cfg file then, it doesn't load bots. With the plugin I add an else statement and it loads random bots.


All times are GMT -4. The time now is 16:26.

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