[ Ajuda ] Registro
#1

Olб, estou criando meu GameMode, e nisso estava mexendo no parte de Registro e Login.
Tipo, no pawno deu certo mas quando o Player se registra , a conta dele nгo vai pra Scriptfiles , pra pasta " CONTAS " nгo cria , e nem fica salvo .
Um exemplo para vocкs olharem.
pawn Код:
public OnPlayerConnect(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[128];
    format(String, sizeof(String), CONTAS, Nome);
    calado[playerid] = false;
    tv[playerid] = false;
    if(!dini_Exists(String))
    {
        format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s  {1E90FF}Nгo Registrado\n\n{FFFFFF} Digite Uma Senha Para Continuar", Nome);
        ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_INPUT, "Registro", String, "Registrar", "Cancelar");
    }
    else
    {
        format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s  {1E90FF}Registrado\n\n{FFFFFF} Digite Sua Senha Para Logar", Nome);
        ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Registro", String, "Logar", "Cancelar");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SalvarPlayer(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
        VeiculoOcupado[GetPlayerVehicleID(playerid)] = false;
    }
    return 1;
}
Reply
#2

Apresente aqui o dialogid REGISTRO...
Reply
#3

Posta os cуdigos e as defines.
Reply
#4

pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <sscanf2>
#include <Dini>
#include losgs

#pragma tabsize 0

#define CONTAS "Admin/Players/%s.ini"
#define log "Admin/Admin/Administraзгo.txt"

#define REGISTRO 1
#define LOGIN    2

// ---------- Outros --------- //


Status(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[70];
    SendClientMessage(playerid, 0xFF0000AA, "=========================================");
    format(String, sizeof(String),"Minhas Informaзхes : %s", Nome);
    SendClientMessage(playerid, 0xFFFF00AA,String);
    format(String, sizeof(String),"Dinheiro: %d", GetPlayerMoney(playerid));
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Matou: %d", Matou[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Morreu: %d", Morreu[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Medalhas: %d", medalhas[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Level %d de Admin", PlayerInfo[playerid][Admin]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Level %d de Helper", PlayerInfo[playerid][cHelper]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    SendClientMessage(playerid, 0xFF0000AA, "=========================================");
    return 1;
}

SalvarPlayer(playerid)
{
    new Float:Vida;
    new Float:Colete;
    GetPlayerHealth(playerid, Vida);
    GetPlayerArmour(playerid, Colete);
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), CONTAS, Nome);
    dini_IntSet(String,"Dinheiro", GetPlayerMoney(playerid));
    dini_FloatSet(String,"Vida", Vida);
    dini_FloatSet(String,"Colete", Colete);
    dini_IntSet(String,"Matou", Matou[playerid]);
    dini_IntSet(String,"Morreu", Morreu[playerid]);
    dini_IntSet(String,"Admin", PlayerInfo[playerid][Admin]);
    dini_IntSet(String,"Helper", PlayerInfo[playerid][cHelper]);
    dini_IntSet(String,"Medalhas", medalhas[playerid]);
    return 1;
}

SetarPlayer(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), CONTAS, Nome);
    GivePlayerMoney(playerid, dini_Int(String,"Dinheiro"));
    SetPlayerHealth(playerid, dini_Int(String,"Vida"));
    SetPlayerArmour(playerid, dini_Int(String,"Colete"));
    Matou[playerid] = dini_Int(String, "Matou");
    Morreu[playerid] = dini_Int(String, "Morreu");
    PlayerInfo[playerid][Admin] = dini_Int(String, "Admin");
    PlayerInfo[playerid][cHelper] = dini_Int(String, "Helper");
    medalhas[playerid] = dini_Int(String, "Medalhas");
    return 1;
}
Reply
#5

Quote:
Originally Posted by WKhalifa
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <sscanf2>
#include <Dini>
#include losgs

#pragma tabsize 0

#define CONTAS "Admin/Players/%s.ini"
#define log "Admin/Admin/Administraзгo.txt"

#define REGISTRO 1
#define LOGIN    2

// ---------- Outros --------- //


Status(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[70];
    SendClientMessage(playerid, 0xFF0000AA, "=========================================");
    format(String, sizeof(String),"Minhas Informaзхes : %s", Nome);
    SendClientMessage(playerid, 0xFFFF00AA,String);
    format(String, sizeof(String),"Dinheiro: %d", GetPlayerMoney(playerid));
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Matou: %d", Matou[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Morreu: %d", Morreu[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Medalhas: %d", medalhas[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Level %d de Admin", PlayerInfo[playerid][Admin]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    format(String, sizeof(String),"Level %d de Helper", PlayerInfo[playerid][cHelper]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    SendClientMessage(playerid, 0xFF0000AA, "=========================================");
    return 1;
}

SalvarPlayer(playerid)
{
    new Float:Vida;
    new Float:Colete;
    GetPlayerHealth(playerid, Vida);
    GetPlayerArmour(playerid, Colete);
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), CONTAS, Nome);
    dini_IntSet(String,"Dinheiro", GetPlayerMoney(playerid));
    dini_FloatSet(String,"Vida", Vida);
    dini_FloatSet(String,"Colete", Colete);
    dini_IntSet(String,"Matou", Matou[playerid]);
    dini_IntSet(String,"Morreu", Morreu[playerid]);
    dini_IntSet(String,"Admin", PlayerInfo[playerid][Admin]);
    dini_IntSet(String,"Helper", PlayerInfo[playerid][cHelper]);
    dini_IntSet(String,"Medalhas", medalhas[playerid]);
    return 1;
}

SetarPlayer(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[50];
    format(String, sizeof(String), CONTAS, Nome);
    GivePlayerMoney(playerid, dini_Int(String,"Dinheiro"));
    SetPlayerHealth(playerid, dini_Int(String,"Vida"));
    SetPlayerArmour(playerid, dini_Int(String,"Colete"));
    Matou[playerid] = dini_Int(String, "Matou");
    Morreu[playerid] = dini_Int(String, "Morreu");
    PlayerInfo[playerid][Admin] = dini_Int(String, "Admin");
    PlayerInfo[playerid][cHelper] = dini_Int(String, "Helper");
    medalhas[playerid] = dini_Int(String, "Medalhas");
    return 1;
}
A conta dos jogadores vai ser salva em Admin/Players/%s.ini".
Reply
#6

Quote:
Originally Posted by xCR7
Посмотреть сообщение
A conta dos jogadores vai ser salva em Admin/Players/%s.ini".
Obrigado, Consegui.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)