I need some help for making the input dialog under OnPlayerRequestClass.
I'm not good with the Input dialogs.
Код:
dcmd_login(playerid,params[]) {
if(!strlen(params)) { SendClientMessage(playerid,red,"Syntax Error: \"/LOGIN <PASSWORD>\"."); return 1; }
new index = 0;
new Password[256], string[256]; Password = strtok(params,index);
new PlayerFile[256]; PlayerFile = GetPlayerFile(playerid);
if(Variables[playerid][Registered] && !Variables[playerid][LoggedIn]) {
if(udb_hash(Password) == dini_Int(PlayerFile,"Password")) {
switch(Variables[playerid][Level]) {
case 0: format(string,sizeof(string),"You have logged into your account. [Status Level: Member]");
default: format(string,sizeof(string),"You have logged into your account. [Status Level: Administrator Lv. %d]",Variables[playerid][Level]);
}
SendClientMessage(playerid,blue,string);
SetUserInt(playerid,"LoggedIn",1); Variables[playerid][LoggedIn] = true;
new tmp3[100]; GetPlayerIp(playerid,tmp3,100); SetUserString(playerid,"IP",tmp3);
OnPlayerLogin(playerid,true);
} else { OnPlayerLogin(playerid,false); SendClientMessage(playerid,red,"Syntax Error: \"/LOGIN <PASSWORD>\"."); }
} else SendClientMessage(playerid,red,"Error: You must be registered to log in; if you have make sure you haven't already logged in.");
return 1;
}