Raised This Month: $ Target: $400
 0% 

loading origins from a .cfg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-15-2007 , 22:57   loading origins from a .cfg
Reply With Quote #1

I am making my CTF plugin with .cfg files for the spawn locations of the flag entities. Lets say you install them to: "your_configs_directory\ctf\" and the filename is "map_name.ctf.cfg" so for example "de_aztec.ctf.cfg"

I would get this location/file like this:
Code:
new map_name[32], file[64], config_dir[32] get_configsdir(config_dir,31); get_mapname(map_name,31); formatex(file, 63, "%s/ctf/%s.ctf.cfg", config_dir, map_name);

then I would check if that file exsists, and if so load the origin from it:
Code:
if(file_exists(file)) {      //load info, but I dont know how to do this. }

how would I load the information?

here is an example from my de_aztec.ctf.cfg I made:
Code:
-3311.968750 128.465026 -313.994537
2531.370605 41.470859 -251.968750
counter-terrorist is first, then terrorist.

also attatched. Thanks in advance.
Attached Files
File Type: cfg de_aztec.ctf.cfg (70 Bytes, 85 views)
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-15-2007 , 22:59   Re: loading origins from a .cfg
Reply With Quote #2

note: the origins are form pev_origin, so they are floats, forgot to mention that.


[EDIT] dangit I just realized that GHW-Chronic made this a long time ago *waaa, there is no point in making it now, but it would be nice to know how to load from .cfg files (I also has already stopped using this method and went to searching for info_player_start/deathmatch when my friend told me it was already made )
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 06-15-2007 at 23:29.
Rolnaaba is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-18-2007 , 16:42   Re: loading origins from a .cfg
Reply With Quote #3

read_file
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Reply



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 10:31.


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