Need 1 Thing for My server ! (+1 Rep )
#1

Hi Guys,
I Have created a Server so I was doing other stuff and i dont know how to make Register and Login system, So can Anyone Make it for me on a Filter-script ?

Hope you will Create 1 for me
Thanks I will surely give +1 rep u !! make sure I need it ASAP and first one to give me earns REP !!

Avi.
Reply
#2

Follow this tutorial mate, it's easy to follow and effective for what you want: https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#3

as i told you, im busy so i need someone to make it
Please Help me ASAP
Thanks,.........
Reply
#4

There are millions of registrations systems out there.
Also, there's a button called "Search", it's pretty useful.
http://forum.sa-mp.com/forumdisplay.php?f=17
Reply
#5

Umm, you sure you don't want to make one yourself? I mean, if you can't, I can send you my Y_INI register system.

EDIT: Can't right now, gotta go to my cousins graduation :L if you still need it when I get back, PM me or something
Reply
#6

Please I need Today Only !!
Reply
#7

pawn Код:
#include <zcmd>
#include <sscanf2>
#include <dini>

#define GREY        0xAFAFAFAA
#define GREEN       0x33AA33AA
#define YELLOW      0xFFFF00AA
#define WHITE       0xFFFFFFAA
#define LIGHTBLUE   0x33CCFFAA
#define ORANGE      0xFF9900AA
#define ADMIN       0xFF00FFFF
#define red         0xFF0000AA


enum gPInfo
{
    Logged,
    Regged,
    Level
};


new PInfo[MAX_PLAYERS][gPInfo];
public OnPlayerConnect(playerid)
{
    new n[MAX_PLAYER_NAME], file[256], str[128];
    PInfo[playerid][Logged] = 0;
    PInfo[playerid][Regged] = 0;
    PInfo[playerid][Level] = 0;
    GetPlayerName(playerid,n,sizeof(n));
    format(file,sizeof(file),"FILE LOCATION",n);
    if(dini_Exists(file))
    {
        format(str,sizeof(str), "Welcome back to NAME, %s. Please /login!",n);
        SendClientMessage(playerid,LIGHTBLUE,str);
        PInfo[playerid][Regged] = 1;
        PInfo[playerid][Logged] = 0;
        return 1;
    }
    if(!dini_Exists(file))
    {
        SendClientMessage(playerid,LIGHTBLUE,"You are not registered, Please /register!");
        PInfo[playerid][Regged] = 0;
        PInfo[playerid][Logged] = 0;
        return 1;
    }
    return 1;
}
CMD:register(playerid,params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"FILE LOCATION",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,ORANGE,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, and logged in!");
    if(strlen(params))
    {
        if(!dini_Exists(file))
        {
            dini_Create(file);
            dini_Set(file,"Password",params);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            SendClientMessage(playerid,LIGHTBLUE,"You are now registered. Please /login");
            PInfo[playerid][Regged] = 1;
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
        return 1;
    }
    return 1;
}
CMD:login(playerid,params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"FILE LOCATION",n);
    if(!dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are not registered! Please /register");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already logged in!");
    if(PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,ORANGE,"You are not registered! Please /register");
    if(strlen(params))
    {
        new pass[256];
        pass = dini_Get(file,"Password");
        if(dini_Exists(file))
        {
            if(strcmp(params,pass,false) != 0)
            {
                SendClientMessage(playerid,YELLOW,"Wrong Password!");
            }
            else
            {
            dini_IntSet(file,"Logged",1);
            PInfo[playerid][Logged] = 1;
            PInfo[playerid][Level] = dini_Int(file,"Level");
            SendClientMessage(playerid,YELLOW,"You have now logged in!");
            return 1;
            }
        }
    }
    else
    {
    SendClientMessage(playerid,GREY,"USAGE: /login <Password>");
    return 1;
    }
    return 1;
}
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
#endif
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)