Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. ode
- Encrypt(string[])
- {
- for(new x=0; x < strlen(string); x++)
- {
- string[x] += (3^x) * (x % 15);
- if(string[x] > (0xff))
- {
- string[x] -= 256;
- }
- }
- return 1;
- }
- //============================================================0
- 2.
- public OnPlayerRequestClass(playerid, classid)
- {
- if (!GetPVarInt(playerid, "gPlayerLogged"))
- {
- new playername[MAX_PLAYER_NAME],
- file[128];
- // Clear Chat
- ClearChatBox(playerid);
- // Removes Class Selection
- TogglePlayerSpectating(playerid, 1);
- // Show Connect TextDraws
- ShowConnectTextDraws(playerid);
- GetPlayerName(playerid, playername, sizeof(playername));
- format(file, sizeof(file), "/accounts/%s.ini", playername);
- if(fexist(file))
- {
- new string[256];
- format(string, sizeof(string), DialogTexts[0],
- playername,
- MAX_LOGIN_TIME);
- if(IsPlayerNPC(playerid))
- {
- if(strcmp(playername, "Vozi_Misko", true) == 0)
- {
- new tmppass[64];
- strmid(tmppass, "imjustnpc", 0, strlen("imjustnpc"), 255);
- // --> Encrypt(tmppass);
- LoginPlayer(playerid, tmppass);
- SetPlayerColor(playerid,0xFFFFFF00);
- }
- }
- else
- ShowPlayerDialog(playerid, DIALOG_LOGIN + playerid, DIALOG_STYLE_PASSWORD, "PRIJAVA", string, "Prijava", "Odustani");
- return 1;
- }
- else
- {
- // Registration Step 1 (Agreement)...
- SetPVarInt(playerid, "PlayerRegistrating", 1);
- ShowPlayerDialog(playerid, DIALOG_REG_AGREEMENT + playerid, DIALOG_STYLE_MSGBOX, "REGISTRACIJA - PRVI KORAK (UVJETI KORISTENJA)", DialogTexts[2], "Da", "Ne");
- return 1;
- }
- }
- else
- {
- // Class Selection after death (F4)
- TogglePlayerSpectating(playerid, 1);
- SetTimerEx("OnPlayerRequestClassEx", 2000, 0, "i", playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Ako zelite promjeniti izgled (Skin) svoga lika, posjetite \"Clothing Shop\".");
- return 1;
- }
- }
- //=======================================================================
- 3.
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128],
- playername[MAX_PLAYER_NAME],
- sendername[MAX_PLAYER_NAME];
- if (dialogid == DIALOG_LOGIN + playerid) // Login Dialog
- {
- if (response == 1) // Prijava
- {
- if (!strlen(inputtext)) // IMPORTANT!!!
- {
- PovecajPVarInt(playerid, "gPlayerLogTries", 1);
- new LoginTriesLeft = (MAX_LOGIN_TRIES - GetPVarInt(playerid, "gPlayerLogTries")),
- loginstring[512];
- format(loginstring,sizeof(loginstring), DialogTexts[1],
- MAX_LOGIN_TRIES,
- LoginTriesLeft);
- ShowPlayerDialog(playerid, DIALOG_LOGIN + playerid, DIALOG_STYLE_PASSWORD, "PRIJAVA", loginstring, "Prijava", "Odustani");
- if (GetPVarInt(playerid, "gPlayerLogTries") == MAX_LOGIN_TRIES)
- {
- HideConnectTextDraws(playerid);
- HidePlayerDialog(playerid);
- Ban(playerid);
- }
- return 1;
- }
- new tmppass[64];
- strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
- //-----> Encrypt(tmppass);
- LoginPlayer(playerid, tmppass);
- return 1;
- }
- else // Odustani
- {
- // Hide Connect TextDraws and Kick Player
- HideConnectTextDraws(playerid);
- Kick(playerid);
- return 1;
- }
- }
- //====================================0
- 4.
- else if(dialogid == DIALOG_CHANGEPASSWORD)//novo ubacio
- {
- new novasifra = strlen(inputtext),
- tmppass[64];
- format(string, sizeof(string), "/accounts/%s.ini", ReturnPVarString(playerid, "ImePrezime"));
- if(response == 1)
- {
- if (novasifra < MIN_PASSWORD) // Password too short
- {
- SendClientMessage(playerid, COLOR_RED, "Lozinka je prekratka! (Min 6 znakova)");
- return 1;
- }
- else if (novasifra > MAX_PASSWORD) // Password too long
- {
- SendClientMessage(playerid, COLOR_RED, "Lozinka je preduga! (Max 14 znakova)");
- return 1;
- }
- strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
- //----> Encrypt(tmppass);
- RegisterPlayer(playerid, tmppass);
- format(string, sizeof(string), "Nova lozinka: %s", inputtext);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPVarInt(playerid, "gPlayerLogged", 0);
- SendClientMessage(playerid, COLOR_YELLOW, "Ulogirajte se ponovno s novom sifrom!");
- return 1;
- }
- else
- HidePlayerDialog(playerid);
- }
- //=========================================
- 5.
Advertisement
Add Comment
Please, Sign In to add comment