05.05.2010, 18:22
Quote:
Originally Posted by Steven82
Naked?
|
and i think by naked he means a Unedited login code.
pawn Код:
if(strcmp(cmd, "/login", true) == 0)
{
if(logged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You are already logged in!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SS, "USAGE: /login [password]");
}
else
{
if (dini_Exists(udb_encode(playername)))
{
tmp2 = dini_Get(udb_encode(playername), "password");
if (udb_hash(tmp) != strval(tmp2))
{
SendClientMessage(playerid, COLOR_RED, "Wrong/Invalid Password!");
}
else
{
logged[playerid] = 1;
adminlevel[playerid] = dini_Int(udb_encode(playername), "adminlevel");
format(string, sizeof(string), "%s, you are now logged in );
SendClientMessage(playerid, COLOR, string);
}
}
else
{
format(string, sizeof(string), "You are not registered Type /register [password] to create an account!", playername);
SendClientMessage(playerid, COLOR_RED, string);
}
}
return 1;
}