HELP WITH DIALOG BOX
#1

HI guyz..
I need your help. so how to a login dialog box. and it also show player spawn..
PHP код:
    {
            
cmd_register(playerid,inputtext);
            if (
PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already registered and logged in.");
            if (
udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: This account already exists, please use '/login [password]'.");
            if (
strlen(inputtext) < || strlen(inputtext) > 20) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Password length must be greater than three characters");
            if (
udb_Create(PlayerName2(playerid),inputtext))
            {
                new 
file[256],rname[MAX_PLAYER_NAME], tmp3[100];
                new 
strdate[20], year,month,day;
                
getdate(yearmonthday);
                
GetPlayerName(playerid,rname,sizeof(rname));
                
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(rname));
                 
GetPlayerIp(playerid,tmp3,100);
                
dini_Set(file,"ip",tmp3);
        
//        dini_Set(file,"password",params);
                
dUserSetINT(PlayerName2(playerid)).("registered",1);
                   
format(strdatesizeof(strdate), "%d/%d/%d",day,month,year);
                
dini_Set(file,"RegisteredDate",strdate);
                
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
                
dUserSetINT(PlayerName2(playerid)).("banned",0);
                
dUserSetINT(PlayerName2(playerid)).("level",0);
                
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
                
dUserSetINT(PlayerName2(playerid)).("money",0);
                
dUserSetINT(PlayerName2(playerid)).("kills",0);
                   
dUserSetINT(PlayerName2(playerid)).("deaths",0);
                
PlayerInfo[playerid][LoggedIn] = 1;
                
PlayerInfo[playerid][Registered] = 1;
                
SendClientMessage(playeridgreen"ACCOUNT: You are now registered, and have been automaticaly logged in");
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                return 
1;
            }
        } 
Reply
#2

Quote:
Originally Posted by RocketBoy
Посмотреть сообщение
HI guyz..
I need your help. so how to a login dialog box. and it also show player spawn..
PHP код:
    {
            
cmd_register(playerid,inputtext);
            if (
PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already registered and logged in.");
            if (
udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: This account already exists, please use '/login [password]'.");
            if (
strlen(inputtext) < || strlen(inputtext) > 20) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Password length must be greater than three characters");
            if (
udb_Create(PlayerName2(playerid),inputtext))
            {
                new 
file[256],rname[MAX_PLAYER_NAME], tmp3[100];
                new 
strdate[20], year,month,day;
                
getdate(yearmonthday);
                
GetPlayerName(playerid,rname,sizeof(rname));
                
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(rname));
                 
GetPlayerIp(playerid,tmp3,100);
                
dini_Set(file,"ip",tmp3);
        
//        dini_Set(file,"password",params);
                
dUserSetINT(PlayerName2(playerid)).("registered",1);
                   
format(strdatesizeof(strdate), "%d/%d/%d",day,month,year);
                
dini_Set(file,"RegisteredDate",strdate);
                
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
                
dUserSetINT(PlayerName2(playerid)).("banned",0);
                
dUserSetINT(PlayerName2(playerid)).("level",0);
                
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
                
dUserSetINT(PlayerName2(playerid)).("money",0);
                
dUserSetINT(PlayerName2(playerid)).("kills",0);
                   
dUserSetINT(PlayerName2(playerid)).("deaths",0);
                
PlayerInfo[playerid][LoggedIn] = 1;
                
PlayerInfo[playerid][Registered] = 1;
                
SendClientMessage(playeridgreen"ACCOUNT: You are now registered, and have been automaticaly logged in");
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                return 
1;
            }
        } 

Try that instead, and instead of putting COL_WHITE for the color, put the code of the color :

Код:
public OnPlayerConnect(playerid)
{
	GameTextForPlayer(playerid,"~w~Grand Larceny",3000,4);
  	SendClientMessage(playerid,COLOR_WHITE,"Welcome to {88AA88}G{FFFFFF}rand {88AA88}L{FFFFFF}arceny");
  	
  	// class selection init vars
  	gPlayerCitySelection[playerid] = -1;
	gPlayerHasCitySelected[playerid] = 0;
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }else{
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }

 	return 1;
}
Reply
#3

error
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)