Szerző Téma: Help me regbe  (Megtekintve 616 alkalommal)

Nem elérhető shadee

  • 1073
    • Profil megtekintése
Help me regbe
« Dátum: 2011. június 13. - 20:32:42 »
0 Show voters
Üdv,CSináltam 1 regisztrációs fs-et de 2 baj van,
1:Bármilyen Jelszóval Betudok Lépni,
2:adok magamnak admint,Kilépek Utána átírja magát 0ára:S
Lécci Segítsetek kijavítani
Script:
 
//============================================================================//
#include <a_samp>
#include <dini>
#include <dutils>
#pragma tabsize 0
//============================================================================//
#define COLOR_MESSAGE 0x00C7FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000FF
#define COLOR_YELLOW 0xFFFF0088
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOUR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_GREEN2 0x33FF33AA
#define COLOR_ERROR 0xFF0000AA
#define COLOR_MSG 0x00FFFFFF
#define COLOR_PINK 0xFF66FFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN1 0x33AA33AA
#define COLOR_BROWN 0xA52A2AAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_BLACK 0x000000AA
#define COLOR_GREEN1 0x33AA33AA
//**********************************DIALOGS***********************************//
//============================================================================//
#define REGISTERDIALOG 500
#define LOGINDIALOG 501
#define STATS 502
//*******************************DEFINE DCMD**********************************//
//============================================================================//
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//**********************************ENUM*************************************//
//============================================================================//
enum PlayerData
{
Name[MAX_PLAYER_NAME],
IP[16],
Registered,
Password,
LoggedIn,
adminszint,
 Olesek,
Halalok
};
//***********************************NEW**************************************//
//============================================================================//
new PlayerInfo[MAX_PLAYERS][PlayerData];
//*******************************CALLBACKS************************************//
//============================================================================//
public OnFilterScriptInit()
{
printf(\"******************************************************************\");
printf(\"Regisztrációs Rendszer betöltése\");
printf(\"******************************************************************\");
return 1;
}
//============================================================================//
public OnPlayerConnect(playerid)
{
    new playername[MAX_PLAYER_NAME];
    new string1[64];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string1, sizeof(string1), \"--%s (ID: %d) csatlakozott a Szerverhez--\", playername, playerid);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string1);
    new file[128];
format(file, sizeof(file), \"Felhasznalok/%s.ini\", pName(playerid));
    PlayerInfo[playerid][Name] = playername;
PlayerInfo[playerid][iP] = 0;
PlayerInfo[playerid][Registered] = 0;
PlayerInfo[playerid][LoggedIn] = 0;
PlayerInfo[playerid][Password] = 0;
PlayerInfo[playerid][Password] = dini_Int(file,\"Jelszo\");
    PlayerInfo[playerid][Olesek] = dini_Int(file,\"olesek\");
    PlayerInfo[playerid][Halalok] = dini_Int(file,\"Halalok\");
    if(userfile(playerid))
{
{
ShowPlayerDialog(playerid, LOGINDIALOG, DIALOG_STYLE_INPUT, \"Bejelentkezés\", \"Írd Be a Jelszót\", \"Login\", \"Mégse\");
new msg2[128];
    format(msg2, sizeof(msg2), \"Jelentkezz be.\");
    SendClientMessage(playerid, COLOR_LIGHTGREEN, msg2);
        }
     }
else
{
    ShowPlayerDialog(playerid, REGISTERDIALOG ,DIALOG_STYLE_INPUT, \"Regisztráció\", \"Írd Be a Jelszót.\\n Emlékezz a Jelszóra\",\"Regisztráció\",\"Mégse\");
new msg3[128];
          format(msg3, sizeof(msg3), \"Üdvözöllek a Szerveren: %s. Kérlek Regisztrálj.\", pName(playerid));
        SendClientMessage(playerid, COLOR_LIGHTGREEN, msg3);
}
return 1;
}
//============================================================================//
public OnPlayerDisconnect(playerid, reason)
{
    new pfile[256];
format(pfile,sizeof(pfile),\"Felhasznalok/%s.ini\", pName(playerid));
dini_IntSet(pfile,\"Olesek\",PlayerInfo[playerid][Olesek]);
dini_IntSet(pfile,\"Halalok\",PlayerInfo[playerid][Halalok]);
dini_IntSet(pfile,\"Adminszint\",PlayerInfo[playerid][adminszint]);
 
return 1;
}
//============================================================================//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new playername[MAX_PLAYERS];
GetPlayerName(playerid, playername, sizeof(playername));
    if(dialogid == REGISTERDIALOG)
    {
        if(response == 1)
{
   if(!inputtext[0])
   {
      ShowPlayerDialog(playerid, REGISTERDIALOG ,DIALOG_STYLE_INPUT, \"Regisztráció\", \"AD Meg a Jelszót.\",\"regisztráció\",\"Mégse\");
      return 1;
   }
            new pfile[128];
   format(pfile, sizeof(pfile), \"Felhasznalok/%s.ini\", pName(playerid));
   new Ip[16];
   GetPlayerIp(playerid,Ip,sizeof(Ip));
   new password = num_hash(inputtext);
          PlayerInfo[playerid][Password] = password;
          PlayerInfo[playerid][Registered] = 1;
   PlayerInfo[playerid][LoggedIn] = 1;
   dini_Create(pfile);
   dini_IntSet(pfile,\"jelszo\",PlayerInfo[playerid][Password]);
   dini_Set(pfile,\"Ip\",Ip);
            PlayerInfo[playerid][Olesek] = 0;
          PlayerInfo[playerid][Halalok] = 0;
          dini_IntSet(pfile,\"olesek\",0);
   dini_IntSet(pfile,\"halalok\",0);
   SendClientMessage(playerid, COLOR_GREY, \"Regisztráció Vége\");
           SendClientMessage(playerid, COLOR_GREY, \"Üdvözöllek a Szerveren.\");
   new string[256];
   format(string, sizeof(string), \"Jelszót: \\\'%s\\\'.\", inputtext);
   SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
   }
if(response == 0)
{
    Kick(playerid);
    new string[256];
   format(string, sizeof(string),\"%s Nem Regisztráltál ezért Kickellve Lettél\",playername);
   SendClientMessageToAll(COLOR_RED, string);
}
}
if(dialogid == LOGINDIALOG)
    {
        if(response == 1)
{
            new password = num_hash(inputtext);
       if(PlayerInfo[playerid][Password] == password)
   Autolog(playerid);
   SendClientMessage(playerid, COLOR_LIGHTGREEN, \"Üdv Újra.\");
   }
   else
   {
   Kick(playerid);
   new string1[256];
   format(string1, sizeof(string1),\"%s Kickellve Lettél!mert nem jelentkeztél Be\",playername);
   SendClientMessageToAll(COLOR_RED, string1);
   }
}
    if(response == 0)
{
   Kick(playerid);
    new string1[256];
   format(string1, sizeof(string1),\"%s hNem jelentkeztél be!Kickellve Lettél\",playername);
   SendClientMessageToAll(COLOR_RED, string1);
    }
return 1;
}
//============================================================================//
public OnPlayerDeath(playerid, killerid, reason)
{
new pname[24], kfile[50], pfile[50], kname[24];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(killerid, kname, sizeof(kname));
format(kfile, sizeof(kfile), \"Felhasznalok/%s.ini\", kname);
format(pfile, sizeof(pfile), \"Felhasznalok/%s.ini\", pname);
if(killerid == INVALID_PLAYER_ID)
{
       SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
       PlayerInfo[playerid][Halalok]++;
       dini_IntSet(pfile, \"halalok\", PlayerInfo[playerid][Halalok]);
}
else
{
    SendDeathMessage(killerid, playerid, reason);
      PlayerInfo[killerid][Olesek]++;
      PlayerInfo[playerid][Halalok]++;
      dini_IntSet(pfile, \"halalok\", PlayerInfo[playerid][Halalok]);
         dini_IntSet(pfile, \"olesek\", PlayerInfo[killerid][Olesek]);
}
return 1;
}
//============================================================================//
public OnPlayerClickPlayer(playerid,clickedplayerid,source)
{
if(clickedplayerid == playerid)
{
new statstr[500];
format(statstr, sizeof(statstr), \"Nev: %s\\nIP: %d\\nOlesek: %d\\nHalalok: %d\",PlayerInfo[playerid][Name],PlayerInfo[playerid][iP],PlayerInfo[playerid][Olesek],PlayerInfo[playerid][Halalok]);
ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX,\"Stat\", statstr, \"Ok\", \"Mégse\");
}
return 1;
}
//**********************************STOCKS************************************//
//============================================================================//
stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
//============================================================================//
stock userfile(playerid)
{
new FilePath[128];
format(FilePath, sizeof(FilePath), \"Felhasznalok/%s.ini\", pName(playerid));
if(dini_Exists(FilePath)) return 1;
return 0;
}
//============================================================================//
stock Autolog(playerid)
{
new file[128];
format(file, sizeof(file), \"Felhasznalok/%s.ini\", pName(playerid));
PlayerInfo[playerid][LoggedIn] = 1;
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][Olesek] = dini_Int(file,\"olesek\");
    PlayerInfo[playerid][Halalok] = dini_Int(file,\"halalok\");
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal