[AJUDA] /registrar :S
#2

Nгo й vocк que estб fazendo, isto nгo й bug й criptografia destinada aos simbolos que vocк digitou, para que transforme uma string em simbolos...
pawn Код:
Encrypt(tmppass);
Tente usar ZCMD / sscanf e algum cache de arquivos aproveitando que teu GM й do 0, para melhorar o andamento dele e facilitar para o seu lado...

Ex ZCMD / sscanf, SII files:
pawn Код:
#include <a_samp>
#include <ZCMD>
#include <sscanf2>
#include <SII>

CMD:registrar(playerid, params[])
{
    new str[40], senha[50], n[MAX_PLAYER_NAME];
    if(sscanf(params,"s[50]", senha)) return SendClientMessage(playerid, -1, "Digite uma senha..");
    GetPlayerName(playerid, n, sizeof( n ));
    format(str, sizeof( str ) , "%s.ini", n);
    INI_Open(str);
    INI_WriteString("Senha", senha);
    INI_Save();
    INI_Close();
    return 1;
}
Ex2 CB:OnPlayerCommandText - strcmp, strtok, Files Functions:
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[40], cmd[20], idx, str[128], n[MAX_PLAYER_NAME];
    cmd=strtok(cmdtext,idx);
    if(!strcmp(cmd, "/registrar", true))
    {
        GetPlayerName(playerid, n, sizeof( n ));
        format(str, sizeof( str ), "%s.ini", n);
        new File:j=fopen(str, io_write);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return false;
        new write[128];
        format(write, 24, "Senha = %s", tmp);
        fwrite(j, write);
        fclose(j);
        return 1;
    }
    return 1;
}
   
   
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Messages In This Thread
[AJUDA] /registrar :S - by HarryPoter(Owner) - 15.03.2012, 05:00
Re: [AJUDA] /registrar :S - by Jeffrey_Hatrix Jeffrey_ - 15.03.2012, 05:02
Re: [AJUDA] /registrar :S - by Ghost_ - 15.03.2012, 10:24
Re: [AJUDA] /registrar :S - by HarryPoter(Owner) - 15.03.2012, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)