SA-MP Forums Archive
Input thing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Input thing (/showthread.php?tid=157674)



Input thing - jegiro - 07.07.2010

Hello,

I need some help for making the input dialog under OnPlayerRequestClass.
I'm not good with the Input dialogs.

I need to make from this:
Код:
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;
}