well I have been trying to write good examples of how u can use a cfg file but I think best would be if u see an actually example so without further ado here is a small place from Lud's map cvar plugin :
Code:
if(file_exists("addons/amxx/custom/map_cvars.txt") == 1){
new line = 0
new data[128]
new stextsize = 0
new type[4]
new map_or_lock[32]
new map_cvar[64]
new value[32]
log_message("[AMXX][MAPCVARS] Cvar exec / plugin pause-unpause begin")
while((line=read_file("addons/amxx/custom/map_cvars.txt",line,data,128,stextsize))!=0){
parse(data,type,4,map_or_lock,32,map_cvar,64,value,32)
if(equali(type,"M",1)){
if(map_on == true){
map_on = false
}
if( (equali(map_or_lock,ThisMap)) || (equali(map_or_lock,"*allmaps")) ){
map_on = true
}
}
else if(equali(type,"C",1)){
if(map_on == true){
copy(locked_cvar[inum_cvars],64,map_cvar)
copy(locked_value[inum_cvars],32,value)
if(equal(map_or_lock,"1"))
locked_yn[inum_cvars] = 1
if(cvar_exists(map_cvar)){
server_cmd("%s %s",map_cvar,value)
log_message("[AMXX][MAPCVARS] Executed: %s %s",map_cvar,value)
inum_cvars +=1
if(inum_cvars >= 25){
map_on = false
log_message("[AMXX][MAPCVARS] Warning: Limit of 25 special cvars reached.")
}
}else{
invalid = 1
log_message("[AMXX][MAPCVARS] Warning: Cvar ^"%s^" does not exist.", map_cvar)
}
}
}
else if(equali(type,"P",1)){
if(map_on == true){
if(equali(map_or_lock,"P",1))
do_pplugin(0,map_cvar)
else if(equali(map_or_lock,"U",1))
do_pplugin(1,map_cvar)
}
}
}
just gotta let the plugin read specific "words/cvars" in the file and then place a