Cant load script
#8

Ok i have downloaded dini.inc and i have put in the folder filterscripts. My pawn file is also inside that folder. i opned press F5 the same result again. So what i have to do ?

/*
* Dini 1.5.1
* © Copyright 2006 by DracoBlue
*
* @author : DracoBlue (http://dracoblue.com)
* @date : 13th May 2006
* @update : 3rd June 2007
* @require : DUtils 1.8
*
* This file is provided as is (no warranties).
*
* Feel free to use it, a little message in
* about box is honouring thing, isn't it?
*
*/

#if defined _dini_included
#endinput
#endif

#define _dini_included
#pragma library dutils

#include <dutils>

stock dini_Exists(filename[]) {
if (fexist(filename)) return true;
return false;
}

stock dini_Remove(filename[]) {
if (!fexist(filename)) return false;
fremove(filename);
return true;
}

stock dini_Create(filename[]) {
new File:fhnd;
if (fexist(filename)) return false;
fhnd=fopen(filename,io_write);
fclose(fhnd);
return true;
}

stock dini_PRIVATE_ExtractKey(line[]) {
new tmp[MAX_STRING];
tmp[0]=0;
if (strfind(line,"=",true)==-1) return tmp;
set(tmp,strlower(ret_memcpy(line,0,strfind(line,"= ",true))));
return tmp;
}

stock dini_PRIVATE_ExtractValue(line[]) {
new tmp[MAX_STRING];
tmp[0]=0;
if (strfind(line,"=",true)==-1) {
return tmp;
}
set(tmp,ret_memcpy(line,strfind(line,"=",true)+1,s trlen(line)));
return tmp;
}

stock dini_Set(filename[],key[],value[]) {
new File:fohnd, File:fwhnd;
new bool:wasset=false;
new tmpres[MAX_STRING];
if (key[0]==0) return false; /* If we have no sign in key, it can't be set*/
format(tmpres,sizeof(tmpres),"%s.part",filename);
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fremove(tmpres);
fwhnd=fopen(tmpres,io_write);
// if (!fwhnd) return false;
while (fread(fohnd,tmpres)) {
StripNewLine(tmpres);
if ((!wasset)&&(equal(dini_PRIVATE_ExtractKey(tmpres) ,key,true))) {
/* We've got what needs to be replaced! */
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
wasset=true;
}
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}

if (!wasset) {
format(tmpres,sizeof(tmpres),"%s=%s",key,value);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}

fclose(fohnd);
fclose(fwhnd);

format(tmpres,sizeof(tmpres),"%s.part",filename);
if (fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}


stock dini_IntSet(filename[],key[],value) {
new valuestring[MAX_STRING];
format(valuestring,sizeof(valuestring),"%d",value) ;
return dini_Set(filename,key,valuestring);
}

stock dini_Int(filename[],key[]) {
return strval(dini_Get(filename,key));
}

stock dini_FloatSet(filename[],key[],Float:value) {
new valuestring[MAX_STRING];
format(valuestring,sizeof(valuestring),"%f",value) ;
return dini_Set(filename,key,valuestring);
}

stock Float:dini_Float(filename[],key[]) {
return floatstr(dini_Get(filename,key));
}

stock dini_Bool(filename[],key[]) {
return strval(dini_Get(filename,key));
}

stock dini_BoolSet(filename[],key[],value) {
new valuestring[MAX_STRING];
format(valuestring,sizeof(valuestring),"%d",value) ;
return dini_Set(filename,key,valuestring);
}

stock dini_Unset(filename[],key[]) {
new File:fohnd, File:fwhnd;
new tmpres[MAX_STRING];
format(tmpres,sizeof(tmpres),"%s.part",filename);
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
fremove(tmpres);
fwhnd=fopen(tmpres,io_write);
// if (!fwhnd) return false;
while (fread(fohnd,tmpres)) {
StripNewLine(tmpres);
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
/* We've got what needs to be removed! */
} else {
format(tmpres,sizeof(tmpres),"%s",tmpres);
fwrite(fwhnd,tmpres);
fwrite(fwhnd,"\r\n");
}
}

fclose(fohnd);
fclose(fwhnd);

format(tmpres,sizeof(tmpres),"%s.part",filename);
if (fcopytextfile(tmpres,filename)) {
return fremove(tmpres);
}
return false;
}

stock dini_Get(filename[],key[]) {
new File:fohnd;
new tmpres[MAX_STRING];
new tmpres2[MAX_STRING];
tmpres[0]=0;
fohnd=fopen(filename,io_read);
if (!fohnd) return tmpres;
while (fread(fohnd,tmpres)) {
StripNewLine(tmpres);
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
/* We've got what we need */
tmpres2[0]=0;
strcat(tmpres2,dini_PRIVATE_ExtractValue(tmpres));
fclose(fohnd);
return tmpres2;
}
}
fclose(fohnd);
return tmpres;
}


stock dini_Isset(filename[],key[]) {
new File:fohnd;
new tmpres[MAX_STRING];
fohnd=fopen(filename,io_read);
if (!fohnd) return false;
while (fread(fohnd,tmpres)) {
StripNewLine(tmpres);
if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
/* We've got what we need */
fclose(fohnd);
return true;
}
}
fclose(fohnd);
return false;
}
Reply


Messages In This Thread
Cant load script - by monkuttan - 17.10.2013, 16:17
Re: Cant load script - by thomaswilliams - 17.10.2013, 16:22
Re: Cant load script - by kaisersouse - 17.10.2013, 18:22
Re: Cant load script - by Plix - 17.10.2013, 18:52
Re: Cant load script - by monkuttan - 18.10.2013, 11:18
Re: Cant load script - by JeaSon - 18.10.2013, 11:27
Re: Cant load script - by monkuttan - 18.10.2013, 11:31
Re: Cant load script - by monkuttan - 19.10.2013, 11:30
Re: Cant load script - by monkuttan - 19.10.2013, 11:53
Re: Cant load script - by .::: Ecko :::. - 19.10.2013, 12:34

Forum Jump:


Users browsing this thread: 1 Guest(s)