[Ajuda] Passar FS Registro para GM
#1

gostaria que me ajudassem a passar esse FS para dentro de um GM
jб tentei mas nгo sou bom com isso:

FS Registro:
Код:
// Criado Por Thiago_PS
// Editado Por JFS.
// Motivo do Post : Muitos Pedidos.
// >> Sem BUG << || Assesem : homehots.net || MSN : john_feat@hotmail.com
// Й Nois ! */
#include <a_samp>
#include <Dini>

#define FILTERSCRIPT

#define REGISTRO 1
#define LOGIN    2

#define CONTAS "Players/%s.ini"

new Matou[MAX_PLAYERS];
new Morreu[MAX_PLAYERS];
new Logou[MAX_PLAYERS];

public OnFilterScriptInit()
{
	return 1;
}

public OnFilterScriptExit()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	SalvarPlayer(i);
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}
public OnPlayerConnect(playerid)
{
	new Nome[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Nome, sizeof(Nome));
	new String[100];
	format(String, sizeof(String), CONTAS, Nome);
	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);
	return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
	if(IsPlayerConnected(killerid))
	{
		Matou[killerid]++;
	}
	Morreu[playerid]++;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/status", cmdtext, true, 8) == 0)
	{
		Status(playerid);
		return 1;
	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == REGISTRO)
	{
		if(response)
		{
		    if(!strlen(inputtext))
		    {
				new Nome[MAX_PLAYER_NAME];
				GetPlayerName(playerid, Nome, sizeof(Nome));
				new String[100];
	        	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");
				SendClientMessage(playerid,0x1E90FFAA,"Senha invalida, digite uma senha vбlida");
				return 1;
			}
			new Nome[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Nome, sizeof(Nome));
			new String[100];
			format(String, sizeof(String), CONTAS, Nome);
			dini_Create(String);
			dini_Set(String,"Senha",inputtext);
			dini_IntSet(String,"Dinheiro",0);
			dini_IntSet(String,"Vida", 100);
			dini_IntSet(String,"Colete", 100);
			dini_IntSet(String,"Matou",0);
			dini_IntSet(String,"Morreu",0);
			dini_IntSet(String,"Logou",0);
        	ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "{1E90FF}Pronto vocк se registrou agora digite Sua Senha Para Logar-Se", "Logar", "Cancelar");
			return 1;
		}
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Vocк Foi Kickado Porque Nгo Quis Se Registrar!!");
            Kick(playerid);
            return 1;
        }
    }
    if(dialogid == LOGIN)
	{
		if(response)
		{
			if(!strlen(inputtext))
		    {
				new Nome[MAX_PLAYER_NAME];
				GetPlayerName(playerid, Nome, sizeof(Nome));
				new String[100];
				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");
				SendClientMessage(playerid,0x1E90FFAA,"Senha Incorreta !");
				return 1;
			}
			new Nome[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Nome, sizeof(Nome));
			new String[100];
			format(String, sizeof(String), CONTAS, Nome);
			if(!strcmp(inputtext,dini_Get(String,"Senha"),false))
			{
			    SetarPlayer(playerid);
			    Logou[playerid]++;
			    SendClientMessage(playerid,0x00FF00AA,"Vocк Foi Logado Com Sucesso > Escolha Sua Skin!");
			    return 1;
			}
			else
			{
			    SendClientMessage(playerid,0x00FF00AA,"Senha incorreta digite-a novamente");
				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;
		}
		else
		{
			SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo quis se logar, por este motivo serб Kickado");
			Kick(playerid);
			return 1;
		}
	}
	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,"Logou", Logou[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");
    Logou[playerid] = dini_Int(String, "Logou");
	return 1;
}

Status(playerid)
{
	new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
	new String[128];
 	SendClientMessage(playerid, 0xFF0000AA, "================================================");
	format(String, sizeof(String),"Status De %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),"Vocк Jб Logou %d Vezes Neste Servidor",Logou[playerid]);
	SendClientMessage(playerid, 0x1E90FFAA,String);
    SendClientMessage(playerid, 0xFF0000AA, "================================================");
	return 1;
}
Reply
#2

pawn Код:
// Criado Por Thiago_PS
// Editado Por JFS.
// Motivo do Post : Muitos Pedidos.
// >> Sem BUG << || Assesem : homehots.net || MSN : john_feat@hotmail.com
// Й Nois ! */
#include <a_samp>//C N TIVER NO SEU GM adiciona essa linha
#include <Dini>  //C N TIVER NO SEU GM adiciona essa linha


#define REGISTRO 1//no topo do GM
#define LOGIN    2//no topo do GM

#define CONTAS "Players/%s.ini"//no topo do GM

new Matou[MAX_PLAYERS];//no topo do Gm
new Morreu[MAX_PLAYERS];//no topo do GM
new Logou[MAX_PLAYERS];//no topo do GM
public OnFilterScriptExit()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    SalvarPlayer(i);
    return 1;
}
//public OnPlayerConnect(playerid)//acha essa public no GM e pхe o q n tiver comentado nela
//{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[100];
    format(String, sizeof(String), CONTAS, Nome);
    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);//poe isso na public onplayerdisconect do seu GM
    //return 1;
//}
//public OnPlayerDeath(playerid, killerid, reason) POE O Q N TA COMENTADO POE NESSA PUBLIC DO SEU GM
//{
    if(IsPlayerConnected(killerid))
    {
        Matou[killerid]++;
    }
    Morreu[playerid]++;
    //return 1;
//}

//public OnPlayerCommandText(playerid, cmdtext[])
//{
    if (strcmp("/status", cmdtext, true, 8) == 0) return Status(playerid);//poe essa linha no onplayercommandtext do seu GM
if(!strcmp("/creditos, cmdtext, true))return SendClientMessage(playerid, -1, "Criado Por Thiago_PS & Editado Por JFS.");
//return 0;
//}

//public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])  POE O Q N TA COMENTADO DENTRO DESSA PUBLIC NO GM
//{
    if(dialogid == REGISTRO)
    {
        if(response)
        {
            if(!strlen(inputtext))
            {
                new Nome[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Nome, sizeof(Nome));
                new String[100];
                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");
                SendClientMessage(playerid,0x1E90FFAA,"
Senha invalida, digite uma senha vбlida");
                return 1;
            }
            new Nome[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Nome, sizeof(Nome));
            new String[100];
            format(String, sizeof(String), CONTAS, Nome);
            dini_Create(String);
            dini_Set(String,"
Senha",inputtext);
            dini_IntSet(String,"
Dinheiro",0);
            dini_IntSet(String,"
Vida", 100);
            dini_IntSet(String,"
Colete", 100);
            dini_IntSet(String,"
Matou",0);
            dini_IntSet(String,"
Morreu",0);
            dini_IntSet(String,"
Logou",0);
            ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "
Login", "{1E90FF}Pronto vocк se registrou agora digite Sua Senha Para Logar-Se", "Logar", "Cancelar");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "
Vocк Foi Kickado Porque Nгo Quis Se Registrar!!");
            Kick(playerid);
            return 1;
        }
    }
    if(dialogid == LOGIN)
    {
        if(response)
        {
            if(!strlen(inputtext))
            {
                new Nome[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Nome, sizeof(Nome));
                new String[100];
                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");
                SendClientMessage(playerid,0x1E90FFAA,"
Senha Incorreta !");
                return 1;
            }
            new Nome[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Nome, sizeof(Nome));
            new String[100];
            format(String, sizeof(String), CONTAS, Nome);
            if(!strcmp(inputtext,dini_Get(String,"
Senha"),false))
            {
                SetarPlayer(playerid);
                Logou[playerid]++;
                SendClientMessage(playerid,0x00FF00AA,"
Vocк Foi Logado Com Sucesso > Escolha Sua Skin!");
                return 1;
            }
            else
            {
                SendClientMessage(playerid,0x00FF00AA,"
Senha incorreta digite-a novamente");
                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;
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "
Vocк nгo quis se logar, por este motivo serб Kickado");
            Kick(playerid);
            return 1;
        }
    }
    //return 1;
//}


//poe no fim do GM daqui pra baixo
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,"
Logou", Logou[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");
    Logou[playerid] = dini_Int(String, "
Logou");
    return 1;
}

Status(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    new String[128];
    SendClientMessage(playerid, 0xFF0000AA, "
================================================");
    format(String, sizeof(String),"
Status De %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),"
Vocк Jб Logou %d Vezes Neste Servidor",Logou[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    SendClientMessage(playerid, 0xFF0000AA, "
================================================");
    return 1;
}
Reply
#3

Nгo consegui!

Код:
C:\Users\Daniel Landim\Desktop\Brasil Revolution City\gamemodes\BoB2011 sem registro.pwn(1355) : error 017: undefined symbol "SalvarPlayer"
C:\Users\Daniel Landim\Desktop\Brasil Revolution City\gamemodes\BoB2011 sem registro.pwn(1801) : error 017: undefined symbol "Matou"
C:\Users\Daniel Landim\Desktop\Brasil Revolution City\gamemodes\BoB2011 sem registro.pwn(1801) : error 001: expected token: ";", but found "]"
C:\Users\Daniel Landim\Desktop\Brasil Revolution City\gamemodes\BoB2011 sem registro.pwn(1801) : error 029: invalid expression, assumed zero
Reply
#4

vocк nгo colocou tudo direito entai esses erros da pq ta faltando o SalvarPlayer e a variavel Matou...
Reply
#5

Coloquei tudo certo e compilou certinho, sу q nгo ta salvando as contas, eu coloco la a senha q peder pra registrar e entro no game porem nгo salva!!!
Reply
#6

vc criou a pasta Players na scriptfiles?
Reply
#7

Pharrel, cara vocк me ajudou 100% Rep+ pra vc
Na verdade estб salvando sim, ta tudo certinho amigo, eu no nervosismo estava compilando e nгo troquei o nome do gamemode no server.cfg =)

Deu tudo certo, muito obrigado !!!
Reply
#8

De nada
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)