[PEDIDO]Include
#1

alguem poderia me postar um link ativo da include SII? procurei aqui no Forum achei mas os link's nгo estгo ativos
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=58458
Reply
#3

Nгo funciona /\

alguйm ajuda ae pls: https://sampforum.blast.hk/showthread.php?tid=262922
Reply
#4

Poderia postar йla ja pronta? nгo sei como fazer o arquivo INC certo plz nгo sou bom nisso ainda.....
Reply
#5

PHP код:


//======================================================
// Slick's INI Include 2.0.7
//
// © Copyright 2008-2010, [DRuG]Slick
// This file is provided as is (no warranties).
//======================================================


#pragma dynamic 45000 // Change accordingly!!

#if defined MAX_STRING
    #define INI_MAX_VALUE MAX_STRING
#else
    #define INI_MAX_VALUE 128
#endif
#define INI_MAX_KEY 24
#define INI_MAX_LINE (INI_MAX_KEY + INI_MAX_VALUE + 3)
#define INI_MAX_FILENAME 256
#define INI_MAX_LINES 256


enum E_CACHE
{
    
E_KEY[INI_MAX_KEY],
    
E_VALUE[INI_MAX_VALUE]
}

enum E_FILE
{
    
E_FILENAME[INI_MAX_FILENAME],
    
bool: E_OPEN
}

static 
gCache[INI_MAX_LINES][E_CACHE];
static 
gEmptyCache[E_CACHE];
static 
gFile[E_FILE];
static 
gNoFile[E_FILE];


#define INI_Exist fexist


stock INI_Open(const filename[])
{
    if (!
filename[0]) return false;
    if (
gFile[E_OPEN])
    {
        if (!
strcmp(gFile[E_FILENAME], filename, true)) return true;
        
//return false;
        
INI_Close();
    }
    new 
File: h;
    
h = fopen(filename, io_readwrite);
    if (
h)
    {
        
INI_strcpy(gFile[E_FILENAME], filename, INI_MAX_FILENAME, INI_MAX_FILENAME);
        new 
line[INI_MAX_LINE];
        new 
ln = -1;
        new 
separator;
        while (((
ln + 1) < INI_MAX_LINES) && (fread(h, line)))
        {
            
ln ++;
            
INI_StripLine(line);
            
separator = strfind(line, "=", false);
            if ((
line[0] == ';') || (line[0] == '=') || (separator == -1) || (separator > INI_MAX_KEY))
            {
                if (
line[0] == ';')
                {
                    
INI_strcpy(gCache[ln][E_VALUE], line, INI_MAX_VALUE, INI_MAX_VALUE);
                }
                else
                {
                    
INI_strcpy(gCache[ln][E_VALUE][1], line, INI_MAX_VALUE - 1, INI_MAX_VALUE - 1);
                    
gCache[ln][E_VALUE][0] = ';';
                }
                continue;
            }
            
INI_strcpy(gCache[ln][E_KEY], line, separator, INI_MAX_KEY);
            
INI_strcpy(gCache[ln][E_VALUE], line[separator + 1], INI_MAX_VALUE, INI_MAX_VALUE);
            if (!
gCache[ln][E_VALUE][0]) gCache[ln][E_VALUE][0] = ' ';
        }
        
fclose(h);
        
gFile[E_OPEN] = true;
        return 
1;
    }
    return 
0;
}


stock INI_Save()
{
    if (!
gFile[E_OPEN]) return false;
    new 
File: h;
    
h = fopen(gFile[E_FILENAME], io_write);
    if (
h)
    {
        new 
line[INI_MAX_LINE];
        new 
ln = -1;
        while (((
ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
        {
            
ln ++;
            if (
gCache[ln][E_VALUE][0] == ';')
            {
                if (
gCache[ln][E_VALUE][1])
                {
                    
format(line, sizeof(line), "%s\r\n", gCache[ln][E_VALUE]);
                    
fwrite(h, line);
                    continue;
                }
                
fwrite(h, "\r\n");
                continue;
            }
            
format(line, sizeof(line), "%s=%s\r\n", gCache[ln][E_KEY], gCache[ln][E_VALUE]);
            
fwrite(h, line);
        }
        
fclose(h);
        return 
true;
    }
    return 
false;
}


stock INI_Close()
{
    if (!
gFile[E_OPEN]) return false;
    for (new 
ln; ln < INI_MAX_LINES; ln++) gCache[ln] = gEmptyCache;
    
gFile = gNoFile;
    return 
true;
}


stock INI_ReadString(dest[], const key[], maxlength = sizeof(dest))
{
    if ((!
gFile[E_OPEN]) || (!key[0])) return false;
    new 
ln = -1;
    while (((
ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
    {
        
ln ++;
        if (
gCache[ln][E_VALUE][0] == ';') continue;
        if (!
strcmp(gCache[ln][E_KEY], key, false))
        {
            
INI_strcpy(dest, gCache[ln][E_VALUE], INI_MAX_VALUE, maxlength);
            return 
true;
        }
    }
    return 
false;
}


stock INI_ReadInt(const key[])
{
    new 
dest[12];
    if (
INI_ReadString(dest, key)) return strval(dest);
    return 
false;
}


stock Float: INI_ReadFloat(const key[])
{
    new 
dest[12];
    if (
INI_ReadString(dest, key)) return floatstr(dest);
    return 
0.0;
}


stock INI_WriteString(const key[], const value[])
{
    if ((!
gFile[E_OPEN]) || (!key[0]) || (key[0] == ';') || (strfind(key, "=", false) != -1)) return false;
    new 
ln = -1;
    while (((
ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
    {
        
ln ++;
        if (
gCache[ln][E_VALUE][0] == ';') continue;
        if (!
strcmp(gCache[ln][E_KEY], key, false))
        {
            
INI_strcpy(gCache[ln][E_VALUE], value, INI_MAX_VALUE, INI_MAX_VALUE);
            return 
true;
        }
    }
    
ln ++;
    if (
ln < INI_MAX_LINES)
    {
        
INI_strcpy(gCache[ln][E_KEY], key, INI_MAX_KEY, INI_MAX_KEY);
        
INI_strcpy(gCache[ln][E_VALUE], value, INI_MAX_VALUE, INI_MAX_VALUE);
        return 
true;
    }
    return 
false;
}


stock INI_WriteInt(const key[], value)
{
    new 
dest[12];
    
format(dest, sizeof(dest), "%i", value);
    return 
INI_WriteString(key, dest);
}


stock INI_WriteFloat(const key[], Float: value)
{
    new 
dest[12];
    
format(dest, sizeof(dest), "%0.4f", value);
    return 
INI_WriteString(key, dest);
}


stock INI_RemoveEntry(const key[])
{
    if ((!
gFile[E_OPEN]) || (!key[0]) || (strfind(key, "=", false) != -1)) return false;
    new 
ln = -1;
    while (((
ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
    {
        
ln ++;
        if (
gCache[ln][E_VALUE][0] == ';') continue;
        if (!
strcmp(gCache[ln][E_KEY], key, false))
        {
            for (; 
ln < (INI_MAX_LINES - 1); ln ++)
            {
                
INI_strcpy(gCache[ln][E_KEY], gCache[ln + 1][E_KEY], INI_MAX_KEY, INI_MAX_KEY);
                
INI_strcpy(gCache[ln][E_VALUE], gCache[ln + 1][E_VALUE], INI_MAX_VALUE, INI_MAX_VALUE);
            }
            return 
true;
        }
    }
    return 
false;
}


stock INI_Remove(const filename[])
{
    if (!
filename[0]) return false;
    if ((
gFile[E_OPEN]) && (!strcmp(gFile[E_FILENAME], filename, true))) gFile = gNoFile;
    return 
fremove(filename);
}


stock INI_strcpy(dest[], const source[], numcells = sizeof(source), maxlength = sizeof(dest))
{
    new 
i;
    while ((
source[i]) && (i < numcells) && (i < maxlength))
    {
        
dest[i] = source[i];
        
i ++;
    }
    
dest[(i == maxlength) ? (i - 1) : (i)] = '\0';
}


stock INI_StripLine(string[])
{
    new 
l;
    
l = strlen(string);
    if (
string[l - 2] == '\r') string[l - 2] = '\0';
    if (
string[l - 1] == '\n') string[l - 1] = '\0';
} 
Tб ae.

Ou se quiser:

http://forum.sa-mp.com/showthread.ph...wpost&t=262910
Reply
#6

Rico a include ini й a mesma da Sii? como faзo uma include no formato do arquivo INC?'-'
Reply
#7

Sim, й a mesma.

Para fazer isto abra o bloco de notas.
cole o cуdigo nele.
em seguida vб em arquivo > salvar como.
Escolha um local para salvar e lembre-se de alterar o tipo de documento de:
Documento de texto (.txt) para Todos os arquivos.
no campo "Nome" coloque: SII.inc e salve.
Pronto vocк acabou de salvar um arquivo em formato .inc

Atenciosamente,
Falcon
Reply
#8

Obrigado


_______________________________________
[Furious]Extreme Zombie[1.0]
212.124.127.67:7730
Players: ? / 50
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)