Jump to content

DonErik

Membru
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by DonErik

  1. Revin cu o eroare din consola pe care nu am observat-o 

       Error: Function not registered: 'SSCANF_Init'
       Error: Function not registered: 'SSCANF_IsConnected'
       Error: Function not registered: 'SSCANF_Join'
       Error: Function not registered: 'SSCANF_Leave'
       Error: Function not registered: 'TimeFormat'
       Error: Function not registered: 'bcrypt_verify'
       Error: Function not registered: 'bcrypt_get_hash'
       Error: Function not registered: 'bcrypt_hash'

     

  2. On 10/28/2021 at 7:56 PM, GamerulFOX said:

    bro este un server de la zero iar aia era printre primele comenzi ! Nu am de unde sa am PlayerInfo si pLevel!

    Iti recomand sa-ti faci un enum, cu PlayerInfo, sau P_info deoarece este foarte folositor, si te va ajuta la sistemul de stocare in baza de date, si/sau la sistemul de inregistrare/logare. Mai pe scurt la tot ce faci in GM aproape.

  3. 8 minutes ago, Sancky said:

    recomandarea mea este sa ti rescrii putin login/register-ul, cacheuiesti datele player-ului din db in momentu cand s-a conectat si e inregistrat, si asa faci un query doar la connect, eventual sa aplici si un race sanity check pt ca folosesti query-uri threaded, ai aici un exemplu: https://github.com/pBlueG/SA-MP-MySQL/blob/master/example_scripts/login_system-cache.pwn

    O sa incerc, o sa revin cu un reply.

  4. Pentru register: 

    Dialog:PLAYER_REGISTER(playerid, response, listitem, inputtext[]) {
    	if(!response)
    		return Kick(playerid);
    
    	if(!(6 <= strlen(inputtext) <= 32)) {
    		SendErrorMsg(playerid, "Your password must consist of 6 - 32 characters");
    		return ShowPlayerRegister(playerid);
    	}
    
    	return bcrypt_hash(playerid, "HashPassword", inputtext, 12);
    } 


    Pentru login: 

     

    Dialog:PLAYER_LOGIN(playerid, response, listitem, inputtext[]) {
    	if(!response)
    		return Kick(playerid);
    
    	if(!(6 <= strlen(inputtext) <= 32)) {
    		SendErrorMsg(playerid, "Your password must consist of 6 - 32 characters");
    		return ShowPlayerLogin(playerid);
    	}
    
    	return bcrypt_verify(playerid, "PasswordVerify", inputtext, PlayerInfo[playerid][pPassword]);
    }

     

  5. Salut,

    problema mea este cu hash-ul in baza de date. 'PasswordVerify => InvalidHash("")'.

     

    function HashPassword(playerid) {
    	if(!IsPlayerConnected(playerid)) 
    		return 0;
    
    	bcrypt_get_hash(PlayerInfo[playerid][pPassword]);
    
    	mysql_format(SQL, gString, sizeof gString, "insert into users (Username, Password, registerDate) values ('%e', '%e', '%d')", GetName(playerid), PlayerInfo[playerid][pPassword], gettime());
    	mysql_pquery(SQL, gString, "OnPlayerRegister", "d", playerid);
    	return 1;
    }
    
    function PasswordVerify(playerid, bool: succes) {
        if(!IsPlayerConnected(playerid))
            return 0;
    
        if(!succes) {
            if(++LoginTries[playerid] >= 3) {
                SendErrorMsg(playerid, "You have entered the wrong password way too many times!");
                defer KickEx(playerid);    
                return 1;
            }
            return ShowPlayerLogin(playerid);
        }
    
        mysql_format(SQL, gString, sizeof gString, "select * from users where id = %d", PlayerInfo[playerid][pSQLID]);
        mysql_pquery(SQL, gString, "OnPlayerLogin", "d", playerid);
        return 1;
    }

    Nu am folosit acest include pana acum, si m-am gandit ca este o alternativa mai bune fata de WP, si MD5. 
    Multumesc pentru timpul acordar!

  6. Salut! Am intampinat destul de multe erori in include-uriile de la Y-Less sau mai bine cunoscute YSI.

    De precizat ca eu am dat update la toate include-uriile prezente, + ca este un gamemode de la 0 inceput de mine si ca este modular.

    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_core_entry.inc(307) : error 017: undefined symbol "io_readwrite"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(710) : error 017: undefined symbol "gettime"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1313) : error 017: undefined symbol "GetTickCount"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1322) : error 017: undefined symbol "GetTickCount"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1325) : error 017: undefined symbol "format"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1325) : warning 202: number of arguments does not match definition
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1325) : warning 202: number of arguments does not match definition
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1325) : warning 202: number of arguments does not match definition
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1656) : error 017: undefined symbol "CallLocalFunction"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1688) : error 017: undefined symbol "CallLocalFunction"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1712) : error 017: undefined symbol "fexist"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1712) : warning 215: expression has no effect
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1712) : error 001: expected token: ";", but found ")"
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1712) : error 029: invalid expression, assumed zero
    C:\pawno\include\YSI_Coding\y_hooks\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(1712) : fatal error 107: too many error messages on one line

     

  7. La 29.07.2019 la 10:49, [El.Capo] a spus:

    Aolo, tu esti mai noob ca el de ce sa puna P_Date[id][pAdmin] ? daca nu i-a setat o valoare anume? 

    Incearca asta:

     

    CMD:setadmin(playerid, params[]) {
        new id, gMessage[128], level;
        if(sscanf(params, "ud", id,level)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /setadmin [playerid] [level]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "That player is not online");

        mysql_format(handle, Query, sizeof(Query), "UPDATE `conturi` SET `Admin`='%d' WHERE `Nume`='%s'", level, GetName(id));
        mysql_tquery(handle, Query, "", "");

        format(gMessage, sizeof(gMessage), "* You have set %s has a level %d admin", GetName(id), level);
        SendClientMessage(playerid, 0xFFFFFFFF, gMessage);

        format(gMessage, sizeof(gMessage), "* You have been set as a level %d admin", level);
        SendClientMessage(id, 0xFFFFFFFF, gMessage);    

        P_Data[id][pAdmin] = level;

        return true;
    }

    :/ Mereu imi da eroare asta, nuj cum sa o fac am incercat multe metode.

    image.thumb.png.41e0290c977f2556c051106b7dc17179.png

  8. [debug] OnPlayerDeath(0, 65535, 255)
    [debug] Run time error 5: "Invalid memory access"
    [debug] AMX backtrace:
    [debug] #0 00000014 in public @yC_actor () in GM.amx
    [debug] #1 native CallRemoteFunction () in samp-server.exe
    [debug] #2 0003740c in ?? (0, 22484856, 0) in GM.amx
    [debug] #3 00036c50 in ?? (0, 22484856) in GM.amx
    [debug] #4 0002961c in public OnPlayerCommandText (0, 22484856) in GM.amx
     

    image.thumb.png.166383165134d25104ed2b36b901ff8a.png

     

  9. On 2/7/2019 at 6:57 PM, Banditul said:

    Te referi la asta?

    Sau la asta? 

    Pentru ca din ce vad eu primul poate fi folosit cu baza de la burned si in al doilea vad ca contine baza

    -

  10. Acum 7 minute, Kiran a spus:

    Pai o faci din map editor, sau cauti un include sau fs cu sistem de apartamente si cauti daca are usa prin deschidere cu tasta si ii modifici pozitiile respectiv modelul usii

    Buna, idee dar astept sa revina wiki samp si forumul lord.

     

  11. {PAWN}
    CMD:enter(playerid,params)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, -2167.3972,3306.8318,95.5800)) 
        {
         return  SendClientMessage(playerid, COLOR_WITHE,"Nu esti la punctul de intrare");
        }
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFF, "You are not admin");
        SendClientMessage(playerid, COLOR_RED,"Ai intrat in STAFFHQ");
        SetPlayerPos(playerid,-1334.8776,2369.5540,599.3223);
        return 1;
       }

    {PAWN}

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.