[Ajuda] Dini
#1

Topo

pawn Код:
#include <Dini>
#define Vipado "Vip/%s.ini"
Public OnPlayerConnect

pawn Код:
public OnPlayerConnect(playerid)
{
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    dini_Create(String);
    dini_IntSet(String,"Vip",0);
    SetarPlayer(playerid);
    return 1;
}
Public OnPlayerDisconnect

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    SalvarPlayer(playerid);
    return 1;
}
Stock SalvarPlayer

pawn Код:
SalvarPlayer(playerid)
{
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    dini_IntSet(String,"Vip", Vip[playerid]);
    return 1;
}
Stock SetarPlayer

pawn Код:
SetarPlayer(playerid)
{
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    Vip[playerid] = dini_Int(String, "Vip");
    return 1;
}
Problema: Eu crio a pasta Vip nas Scriptfiles, dae quando eu logo digito o comando pra virar vip disconnecto e nao aparece meu nome la!!!
Reply
#2

Tenta:
pawn Код:
public OnPlayerConnect(playerid)
{
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    if(!dini_Exists(String)) dini_Create(String);
    dini_IntSet(String,"Vip",0);
    SetarPlayer(playerid);
    return 1;
}
Reply
#3

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Tenta:
pawn Код:
public OnPlayerConnect(playerid)
{
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    if(!dini_Exists(String)) dini_Create(String));
    dini_IntSet(String,"Vip",0);
    SetarPlayer(playerid);
    return 1;
}
Vai dar erro. E ele jб usou dini_Create.

@Edit jб tentou criar sem aquele #define - ? eu nunca usei assim e nгo vi outro erro. Vou fazer um aqui e testar ai te mando.
Reply
#4

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Vai dar erro. E ele jб usou dini_Create.

@Edit jб tentou criar sem aquele #define - ? eu nunca usei assim e nгo vi outro erro. Vou fazer um aqui e testar ai te mando.
Vai dar erro й tenso leia o cуdigo, ali estou fazendo um verificaзгo, caso o nome do player nгo existe na pasta irб criar ._.
Reply
#5

Cole isso que tu postou no Pawno e tenta compilar se tu conseguir te dou um reputation (Y),
Podia ao menos compilar os code que posta antes mesmo de postar.

@EDIT: Lipe eu consegui perfeitamente, ele salvou a pasta e o nome. Vocк deve estar errando algo :/
Criou a pasta correta? e como vocк estб tentando usar isso, em comando?

pawn Код:
#include <a_samp>
#include <Dini>

#define Vipado "Vip/%s.ini"

new Nome[MAX_PLAYER_NAME];
new Vip[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    new String[50];  GetPlayerName(playerid,Nome,sizeof(Nome));
    format(String, sizeof(String), Vipado, Nome);
    dini_Create(String);
    dini_IntSet(String,"Vip",0);
    SetarPlayer(playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SalvarPlayer(playerid);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/vip", true))
    {
        Vip[playerid] = 1;
        return 1;
    }
    return 0;
}
SalvarPlayer(playerid)
{
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    dini_IntSet(String,"Vip", Vip[playerid]);
    return 1;
}

SetarPlayer(playerid)
{
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), Vipado, Nome);
    Vip[playerid] = dini_Int(String, "Vip");
    return 1;
}
Aqui funcionou perfeitamente, eu criei a pasta Vip, e funfou. Tente ai, se estб tudo correto, qualquer coisa fale aqui novamente.
Reply
#6

Edit @.@
Reply
#7

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Cole isso que tu postou no Pawno e tenta compilar se tu conseguir te dou um reputation (Y),
Podia ao menos compilar os code que posta antes mesmo de postar.
Para de querer se aparecer ...
Ta postando como se ele tivesse postado algo que iria crashar o compilador, esquecer ou add alguma ) ; } a mais й um erro comum, entгo nгo faz esse drama todo
Reply
#8

Edit @.@
Reply
#9

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Cara vocк nгo entendeu? ele quer ser o bom compilar manda tudo direitinho quer ser perfeito ou seja, quer servir cafй com bolachas para todos.
Nгo manolo, ele quer й +rep pra se achar cada vez mais em cima do que nгo precisa ser criticado de tal forma xD
Reply
#10

Edit @.@
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)