16.06.2012, 04:44
(
Last edited by ipsBruno; 16/06/2012 at 05:15 AM.
)
Aqui um exemplo:
Foi atualizado a include. Vejam !!
pawn Code:
stock INI_ParseFile(file[], callback[] = "") {
static
File:open,
stringValue[128],
stringBuffer[128], i;
open = fopen(file, io_read);
while(fread(open, stringBuffer)) {
stringBuffer[strlen(stringBuffer) - 2] = EOS;
if((i = strfind(stringBuffer, "=", false)) != -1) {
strmid(stringValue, stringBuffer, 0, i);
format(stringBuffer, 128, stringBuffer[i +1]);
stringSet(stringValue, stringBuffer);
}
}
return CallLocalFunction(callback, "");
}
public OnFilterScriptInit() {
INI_ParseFile("rs.bs", "rsBs");
return true;
}
forward rsBs();
public rsBs() {
print(stringGet("Deaths"));
return printf("leitura do arquivo executada com sucesso");
}