Code:
// somehow grab what they typed in
// we'll assume that the variable "foobar"
// contains the abbreviated name of the map
// the file to read from
new file[64];
file = "addons/amxmodx/data/yourfilehere.ini";
// if file does not exist, give up now
if(!file_exists(file)) {
return PLUGIN_HANDLED;
}
// data for reading
new line, text[64], txtlen;
// go through lines in the file
while((line = read_file(file,line,text,63,txtlen)) != 0) {
// abbreviation for this map and the full name
new abbrev[32], mapname[32];
// split the data into the variables
parse(text,abbrev,31,mapname,31);
// get rid of quotes
remove_quotes(mapname);
// if we found a match
if(equali(abbrev,foobar)) {
server_cmd("changelevel %s",mapname); // change the map
}
break; // stop looping
}
return PLUGIN_HANDLED;
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS