[Help] Clan Tag
#6

pawn Код:
enum pInfo
{
    pLogged,
    pAdmin,
    pClanTag[5],
    pMoney,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
CMD:login(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new file[128];
        new password[256];
        new message[128];
        new spassword[256];
        format(file, sizeof(file), "%s.ini", ReturnPlayerName(playerid));
        if(sscanf(params, "s", password)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /login [password]");
        if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to register first, type /register");
        if(PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You're already logged in");
        spassword = dini_Get(file, "hashPW");
        if(udb_hash(password) != strval(spassword))
        {
            format(message, sizeof(message), "SERVER: Invalid password");
            SendClientMessage(playerid, COLOR_WHITE, message);
        }
        else
        {
            PlayerInfo[playerid][pLogged] = 1;
            PlayerInfo[playerid][pAdmin] = dini_Int(file, "admlvl");
            PlayerInfo[playerid][pMoney] = dini_Int(file, "money");
                strmid(PlayerInfo[playerid][pClanTag], dini_Get(file, "clantag"), 0, strlen(dini_Get(file, "clantag")), 255);
            GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
            format(message, sizeof(message), "SERVER: Welcome back, %s.", ReturnPlayerName(playerid));
            SendClientMessage(playerid, COLOR_WHITE, message);
        }
    }
    return 1;
}
Reply


Messages In This Thread
[Help] Clan Tag - by Dudits - 19.07.2010, 08:21
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 08:24
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 08:25
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 08:26
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 08:29
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 08:35
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 08:45
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 08:46
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 08:59
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 09:00
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 09:03
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 09:04
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 09:08
Re: [Help] Clan Tag - by Carlton - 19.07.2010, 09:12
Re: [Help] Clan Tag - by Dudits - 19.07.2010, 09:15

Forum Jump:


Users browsing this thread: 1 Guest(s)