AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   loading origins from a .cfg (https://forums.alliedmods.net/showthread.php?t=56545)

Rolnaaba 06-15-2007 22:57

loading origins from a .cfg
 
1 Attachment(s)
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.

Rolnaaba 06-15-2007 22:59

Re: loading origins from a .cfg
 
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 :( )

Vet 06-18-2007 16:42

Re: loading origins from a .cfg
 
read_file


All times are GMT -4. The time now is 10:31.

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