Hashing problems?
#1

Hello!

I've downloaded the "Maddog TDM Revised", for edit the GameMode (i'm "learning" pawno)
But, i've found a bug (hashing problems i think).

When a player insert the password, the system say this:



How to fix?

Sorry for my bad english
Reply
#2

Hmmmm let me thing ..... stil thinking wait ... i thing i know WE NEEED CODE TO HELP YOU
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
Hmmmm let me thing ..... stil thinking wait ... i thing i know WE NEEED CODE TO HELP YOU
Ops, i'm sorry.

Dialogs:
(register & login)

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Server Account",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Helper",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"PlayerLogged",0);
                INI_WriteInt(File,"Muted",0);
                INI_WriteInt(File,"Kicks",0);
                INI_WriteInt(File,"Jails",0);
                INI_WriteInt(File,"Warnings",0);
                INI_WriteInt(File,"Jailed",0);
                INI_WriteInt(File,"AHide",0);
                INI_WriteInt(File,"AdminDuty",0);
                INI_WriteInt(File,"HelperDuty",0);
                INI_WriteInt(File,"Reported",0);
                INI_WriteInt(File,"Weapons",0);
                INI_WriteInt(File,"Spectate",0);
                INI_WriteInt(File,"Registered",0);
                INI_WriteInt(File,"Model",0);
                INI_WriteInt(File,"Member",0);
                INI_WriteInt(File,"AdmName", 0);
                INI_WriteInt(File,"HelName", 0);
                INI_WriteInt(File,"SkinUsed", 0);
                INI_WriteInt(File,"Kills", 0);
                INI_WriteInt(File,"HelpMe", 0);
                INI_WriteInt(File,"DesertEagleKills", 0);
                INI_WriteInt(File,"MarkX", 0);
                INI_WriteInt(File,"MarkY", 0);
                INI_WriteInt(File,"MarkZ", 0);
                INI_WriteInt(File,"Donator", 0);
                INI_WriteInt(File,"FightStyle", 0);
                INI_Close(File);
SendClientMessage(playerid,COLOR_RED,"SERVER: Reconnect to the server now");
Kick(playerid);
                }
        }

        case DIALOG_LOGIN:
        {
            new skin = PlayerInfo[playerid][pModel];
            new string[128];
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    PlayerInfo[playerid][pPlayerLogged] = 1;
                    format(string, sizeof(string), "~w~Welcome ~n~~w~%s!", GetName(playerid));
                    GameTextForPlayer(playerid, string, 2000, 1);
                    SetPlayerInterior(playerid, 5);
                    new Random = random(sizeof(RandomSpawns));
                    SetSpawnInfo(playerid, 1, skin, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2], RandomSpawns[Random][3], 4, 1, 24, 500, 0, 0);
                    SpawnPlayer(playerid);
                    SetPlayerSkin(playerid, skin);
                    SendClientMessage(playerid,COLOR_WHITE,"SERVER: You have logged into your account.");
                    SendClientMessage(playerid,COLOR_WHITE,"______________________________________________");
                    SendClientMessage(playerid,COLOR_WHITE,"                                              ");
                    format(string, sizeof(string), "Script Version: %s", SCRIPT_MODE);
                    SendClientMessage(playerid,COLOR_FADE,string);
                    format(string, sizeof(string), "Last Update: %s", SCRIPT_UPDATE);
                    SendClientMessage(playerid,COLOR_FADE,string);
                    format(string, sizeof(string), "Website: %s", SCRIPT_WEB);
                    SendClientMessage(playerid,COLOR_FADE,string);
                    format(string, sizeof(string), "Ventrilo: %s", SCRIPT_VENT);
                    SendClientMessage(playerid,COLOR_FADE,string);
                    SendClientMessage(playerid,COLOR_WHITE,"______________________________________________");
                    if(PlayerInfo[playerid][pMember] >= 10)
                    {
                        SetPlayerColor(playerid, COLOR_LIGHTRED);
                    }
                    if(PlayerInfo[playerid][pBanned] == 1)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: This account is currently locked");
                        SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You have been IP banned for attempting to ban evade");
                        SendClientMessage(playerid, COLOR_WHITE, "MESSAGE: If you feel this ban is wrong, please post a ban appeal at OSRP.com");
                        Ban(playerid);
                    }
                    if(PlayerInfo[playerid][pSkinUsed] == 0)
                    {
                        SendClientMessage(playerid, COLOR_FADE, "SERVER: You are required to use /skin in order to have a specific skin");
                        TogglePlayerControllable(playerid, false);
                    }
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Server Account",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
Reply
#4

UP? :S
Reply
#5

Another UP .-.
Reply
#6

OMG up, anyone can help me?
Reply
#7

You need first to load player stats, then you can check if the (loaded) password is same as inputted password.
Reply
#8

Create your own gamemode, and you will learn alot more than ripping of others
Reply
#9

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
Create your own gamemode, and you will learn alot more than ripping of others
Is not a rip.
I'm new in Pawno and i want to learn with this GameMode.
I've not removed credits or other.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)