Is it Possible to do this?
#1

Is it possible to convert this to dialog?

pawn Код:
if(gPlayerAccount[playerid] == 1)
        {
            GameTextForPlayer(playerid, "~g~You Are Registered~n~~w~T/login [password] To log in", 5000, 1);
        }
        else
        {
            GameTextForPlayer(playerid, "~g~You are Not Registered~n~~w~/Register [password] To register", 5000, 1);
        }
pawn Код:
if (strcmp(cmd, "/register", true)==0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]");
            return 1;
        }
        if (gPlayerAccount[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "[SERVER]: That name is already registerd.");
            return 1;
        }
        GetPlayerName(playerid, playername, sizeof(playername));
        format(string, sizeof(string), "users/%s.ini", playername);
        PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
        new File: file = fopen(string, io_read);
        if (file)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "[SERVER]: That name is already registerd.");
            gPlayerAccount[playerid] = 0;
            fclose(file);
            return 1;
        }
        OnPlayerRegister(playerid, tmp);

        SendClientMessage(playerid, COLOR_WHITE, "[HINT]: Type (/login <password>) to log in.");
        gPlayerAccount[playerid] = 1;
        strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
        PlayerInfo[playerid][pLevel] = 1;
        OnPlayerDataSave(playerid);
        return 1;
    }
pawn Код:
if (strcmp(cmd, "/login", true) ==0 )
    {
        if (gPlayerLogged[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
            return 1;
        }
        if (gPlayerAccount[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "[SERVER]: You do not have an account, type /register <password>");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /login [password]");
            return 1;
        }
        format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
        new File: hFile = fopen(string, io_read);
        if (hFile)
        {
            fclose(hFile);
            OnPlayerLogin(playerid,tmp);
            return 1;
        }
        return 1;
    }
Reply


Messages In This Thread
Is it Possible to do this? - by traxrex - 30.11.2010, 14:10
Re: Is it Possible to do this? - by Nero_3D - 30.11.2010, 14:22
Re: Is it Possible to do this? - by traxrex - 30.11.2010, 14:23
Re: Is it Possible to do this? - by Guest3598475934857938411 - 30.11.2010, 14:27
Re: Is it Possible to do this? - by Guest3598475934857938411 - 30.11.2010, 14:29
Re: Is it Possible to do this? - by Nero_3D - 30.11.2010, 14:38
Re: Is it Possible to do this? - by traxrex - 01.12.2010, 01:51
Re: Is it Possible to do this? - by traxrex - 01.12.2010, 04:25
Re: Is it Possible to do this? - by Nero_3D - 01.12.2010, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)