[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],
    
boolE_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], filenametrue)) return true;
        
//return false;
        
INI_Close();
    }
    new 
Fileh;
    
fopen(filenameio_readwrite);
    if (
h)
    {
        
INI_strcpy(gFile[E_FILENAME], filenameINI_MAX_FILENAMEINI_MAX_FILENAME);
        new 
line[INI_MAX_LINE];
        new 
ln = -1;
        new 
separator;
        while (((
ln 1) < INI_MAX_LINES) && (fread(hline)))
        {
            
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], lineINI_MAX_VALUEINI_MAX_VALUE);
                }
                else
                {
                    
INI_strcpy(gCache[ln][E_VALUE][1], lineINI_MAX_VALUE 1INI_MAX_VALUE 1);
                    
gCache[ln][E_VALUE][0] = ';';
                }
                continue;
            }
            
INI_strcpy(gCache[ln][E_KEY], lineseparatorINI_MAX_KEY);
            
INI_strcpy(gCache[ln][E_VALUE], line[separator 1], INI_MAX_VALUEINI_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 
Fileh;
    
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(linesizeof(line), "%s\r\n"gCache[ln][E_VALUE]);
                    
fwrite(hline);
                    continue;
                }
                
fwrite(h"\r\n");
                continue;
            }
            
format(linesizeof(line), "%s=%s\r\n"gCache[ln][E_KEY], gCache[ln][E_VALUE]);
            
fwrite(hline);
        }
        
fclose(h);
        return 
true;
    }
    return 
false;
}


stock INI_Close()
{
    if (!
gFile[E_OPEN]) return false;
    for (new 
lnln INI_MAX_LINESln++) 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], keyfalse))
        {
            
INI_strcpy(destgCache[ln][E_VALUE], INI_MAX_VALUEmaxlength);
            return 
true;
        }
    }
    return 
false;
}


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


stock FloatINI_ReadFloat(const key[])
{
    new 
dest[12];
    if (
INI_ReadString(destkey)) 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], keyfalse))
        {
            
INI_strcpy(gCache[ln][E_VALUE], valueINI_MAX_VALUEINI_MAX_VALUE);
            return 
true;
        }
    }
    
ln ++;
    if (
ln INI_MAX_LINES)
    {
        
INI_strcpy(gCache[ln][E_KEY], keyINI_MAX_KEYINI_MAX_KEY);
        
INI_strcpy(gCache[ln][E_VALUE], valueINI_MAX_VALUEINI_MAX_VALUE);
        return 
true;
    }
    return 
false;
}


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


stock INI_WriteFloat(const key[], Floatvalue)
{
    new 
dest[12];
    
format(destsizeof(dest), "%0.4f"value);
    return 
INI_WriteString(keydest);
}


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], keyfalse))
        {
            for (; 
ln < (INI_MAX_LINES 1); ln ++)
            {
                
INI_strcpy(gCache[ln][E_KEY], gCache[ln 1][E_KEY], INI_MAX_KEYINI_MAX_KEY);
                
INI_strcpy(gCache[ln][E_VALUE], gCache[ln 1][E_VALUE], INI_MAX_VALUEINI_MAX_VALUE);
            }
            return 
true;
        }
    }
    return 
false;
}


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


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


stock INI_StripLine(string[])
{
    new 
l;
    
strlen(string);
    if (
string[2] == '\r'string[2] = '\0';
    if (
string[1] == '\n'string[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)