10.01.2012, 07:21
pawn Код:
CMD:register(playerid,params[])
{
if(IsLogged[playerid] == 0)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",PlayerInfo[playerid][Password]);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Skin",0);
INI_Close(File);
SendClientMessage(playerid,COLOR_YELLOW,"You've successfully registered. (login with /login)");
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"You're already registered. Please login with /login.");
}
return 1;
}
CMD:login(playerid,params[])
{
if(PlayerInfo[playerid][Password])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid,COLOR_WHITE,"You've successfully logged in.");
}
else
{
SendClientMessage(playerid,-1,EMBED_RED"WRONG PASSWORD!" EMBED_GREEN "Please attempt to re-login.");
}
return 1;
}