Pomoc

Započeo EdisB
10. Feb. 2014. Zaključano
615
pregleda
19
postova
EdisB
3
Wheel Man
10. Feb. 2014.
Skripta koju koristim😛r Rp koji zelim prevesti.
Detaljan opis problema:Svaki put kad se pokusam registrirati izbaci me sa servera i kaze "Server closed the connection".  Pokusao sam se logovati sa vec napravljenim accovima ali isto sve.
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Blaeks_Biofor
5
Forum Don
10. Feb. 2014.
pogledaj pod OnPlayerConnect da nesto ne koci skriptu
EdisB
3
Wheel Man
10. Feb. 2014.
Blaeks wrote on February 10, 2014, 6:20 pm:
pogledaj pod OnPlayerConnect da nesto ne koci skriptu
a nisam ni ja pro
Blaeks_Biofor
5
Forum Don
10. Feb. 2014.
posalji ga onda ovde
EdisB
3
Wheel Man
10. Feb. 2014.
Cim sjednem za komp
EdisB
3
Wheel Man
11. Feb. 2014.
Evo Register dialoga.
}
case 37: // Register dialog
{
    switch(response)
        {
            case 0: SendClientMessage(playerid,COLOR_WHITE,"This name is not registered, please create an account /register .");
            case 1: // Registering password
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid,37,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account.\nIf you can't support this dialog select the (next) option.","Register", "Next");
                if(strlen(inputtext) >= 31)
                {
    SendClientMessage(playerid, COLOR_WHITE, "Password is too long (30 Chars max).");
    ShowPlayerDialog(playerid,37,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account.\nIf you can't support this dialog select the (next) option.","Register", "Next");
    return 1;
}
                OnPlayerRegister(playerid,inputtext);
            }
        }


Evo OnPlayerRegister
{
if(IsPlayerConnected(playerid))
{
    new string, passwordex;
    format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
if(!DOF2_FileExists(string))
{
    DOF2_CreateFile(string);
    format(passwordex, 128, "%s", password);
    Hash(passwordex);
    DOF2_SetString(string, "Key", passwordex);
    DOF2_SetInt(string, "Convert", 5);
    DOF2_SetInt(string, "Hashed", 1);
    DOF2_SetFloat(string, "PosX", 1642.7285);
    DOF2_SetFloat(string, "PosY", -2240.5591);
    DOF2_SetFloat(string, "PosZ", 13.4945);
    DOF2_WriteFile();
    CallRemoteFunction("OnPlayerLogin","is",playerid,password);
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "Unable to register, account exists.");
    KickEx(playerid);
}
}
return 1;
}


Mada ne radi ni kad se registrujem ni kad se logujem, izbaci, i kaze ''Server Closed the Connection''.. Sve se lijepo registrujem pa izbaci.. Mora da nesto fali.
FiLiP.99
4
Shot Caller
11. Feb. 2014.
Ma ubacis novi Login i Reg system i ne moras se mucis 😄

#include

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo;

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo);
    INI_Int("Cash",PlayerInfo);
    INI_Int("Admin",PlayerInfo);
    INI_Int("Kills",PlayerInfo);
    INI_Int("Deaths",PlayerInfo);
    return 1;
}

stock UserPath(playerid)
{
    new string,playername;
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}


stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n    {
      s1 = (s1 + buf) % 65521;
      s2 = (s2 + s1)    % 65521;
    }
    return (s2 << 16) + s1;
}

public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Write down your password so you could login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Write the password to register.","Register","Quit");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo);
    INI_WriteInt(File,"Kills",PlayerInfo);
    INI_WriteInt(File,"Deaths",PlayerInfo);
    INI_Close(File);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo++;
    PlayerInfo++;
    return 1;
}

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, ""COL_WHITE"Registering...",""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,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
                        }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo)
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo);
                                        ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Your password is inncorect.\n"COL_WHITE"Write down your password to login in.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}

EdisB
3
Wheel Man
11. Feb. 2014.
Ma da, tako je lahko ubaciti log/reg sistem, trebalo bi mi 5 godina.
Ovo je reg sistem kada se registruejs, odgovoris na pitanja, pa admin pregleda ta pitanja pa te prihvati ovo ono, ali ne znam sto nece, trebalo bi..
FiLiP.99
4
Shot Caller
11. Feb. 2014.
EdisB wrote on February 11, 2014, 9:29 am:
Ma da, tako je lahko ubaciti log/reg sistem, trebalo bi mi 5 godina.
Ovo je reg sistem kada se registruejs, odgovoris na pitanja, pa admin pregleda ta pitanja pa te prihvati ovo ono, ali ne znam sto nece, trebalo bi..


Ma gledaj eno u predhodnom postu sam ti stavio kod i samo ubacis ides redom gledas sta je sta i ubacujes polako, a brises staro ! Nije toliko tesko 😄
EdisB
3
Wheel Man
11. Feb. 2014.
Vjeruj da ne znam ☹️
Ako moze poslacu ti gamemode pa da mi zavrsis :S
FiLiP.99
4
Shot Caller
11. Feb. 2014.
EdisB wrote on February 11, 2014, 9:49 am:
Vjeruj da ne znam ☹️
Ako moze poslacu ti gamemode pa da mi zavrsis :S


Ajde posalji mi u PM link od FACEBOOK-a pa ces mi tamo poslati!
Blaeks_Biofor
5
Forum Don
11. Feb. 2014.
frajlo samp, sta pises ti covece ?

uradi kako sam ti ja rekao, znaci tu gde zavrsavas registraciju, u tom delu mu posaljes dialog, i onda pod ondialogresponse potvrdis sve to
FiLiP.99
4
Shot Caller
11. Feb. 2014.
Blaeks wrote on February 11, 2014, 12:14 pm:
frajlo samp, sta pises ti covece ?

uradi kako sam ti ja rekao, znaci tu gde zavrsavas registraciju, u tom delu mu posaljes dialog, i onda pod ondialogresponse potvrdis sve to


? ? ?  Blaeks da li si uopste video taj njegov mod? Mod cim udjes krene da baguje, ima preko 20npc botova ..... Toliko baguje da "Moving Cam" nemoze lepo da se pomera 😄 hhahah ja sam mu preporucio da uzme drugi mod za edit
Blaeks_Biofor
5
Forum Don
11. Feb. 2014.
Frajlo Samp wrote on February 11, 2014, 12:14 pm:
frajlo samp, sta pises ti covece ?

uradi kako sam ti ja rekao, znaci tu gde zavrsavas registraciju, u tom delu mu posaljes dialog, i onda pod ondialogresponse potvrdis sve to


😕
sta nije jasno ?
FiLiP.99
4
Shot Caller
11. Feb. 2014.
Quote
frajlo samp, sta pises ti covece ?


Ovo nije jasno!!?

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha