login system problem help plz
#1

hello i need a example about guest account when player enter wrong pass his name automatically change to guestaccount and that player dont kick

plz tell me some example
Reply
#2

Do you have anything that shows the dialog or message when they get the password wrong?

Try this
pawn Код:
new string [128];
format(string, sizeof(string), "guestaccount_%d", playerid);
SetPlayerName(playerid, string);
Reply
#3

Quote:
Originally Posted by theonethatownz
Посмотреть сообщение
Do you have anything that shows the dialog or message when they get the password wrong?

Try this
pawn Код:
new string [128];
format(string, sizeof(string), "guestaccount_%d", playerid);
SetPlayerName(playerid, string);
PHP код:
if (dialogid == DIALOGID+67)
    {
         if(
response == 0)
        {
            
Kick(playerid);
        }
         if(
response)
        {
            new 
file[128], Pass[256];
            
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
            
Pass dini_Get(file"Password");
             new 
buf[145];
             
WP_Hash(bufsizeof(buf), inputtext);
            if(
strcmp(Passbuffalse) == 0)
            {
                   
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
                
LoginPlayer(playerid);
                new 
pname[MAX_PLAYER_NAME], string[256 MAX_PLAYER_NAME];
                
GetPlayerName(playeridpnamesizeof(pname));
                if(
InClassSelection[playerid] == 1)
                {
                
InterpolateCameraPos(playerid,2213.6919,1423.1891,11.6544,2187.1863,1423.3636,11.6544,10000,CAMERA_MOVE);
                
TextDrawHideForPlayer(playerid,LoadSc2);
                
TextDrawHideForPlayer(playerid,LoadScp3);
                
TextDrawHideForPlayer(playerid,LoadScp4);
                
TextDrawHideForPlayer(playerid,LoadScp5);
                
TextDrawHideForPlayer(playerid,LoadScp6);
                
TextDrawHideForPlayer(playerid,LoadScp7);
                
TextDrawHideForPlayer(playerid,LoadScp8);
                
TextDrawShowForPlayer(playeridclassselection);
                
TextDrawShowForPlayer(playeridclassselection1);
                
TextDrawShowForPlayer(playeridclassselection2);
                
TextDrawShowForPlayer(playeridclickhere);
                
TextDrawShowForPlayer(playeridclassselection6);
                
TextDrawShowForPlayer(playeridclassselection7);
                
TextDrawShowForPlayer(playeridclassselection8);
                
SelectTextDraw(playerid green);
                
PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
                }
                if(
AccInfo[playerid][pVip] > 0)
                {
                switch(
AccInfo[playerid][pVip])
                {
                case 
1AccType "{808000}Bronze_Vip";
                case 
2AccType "{FFFFFF}Silver_Vip";
                case 
3AccType "{FF8000}Golden_Vip";
                }
                
SendClientMessageToAll(LIGHTBLUE,"{400000}______________________________________");
                
format(stringsizeof(string), "%s {80FFFF}%s {FFFFFF}has logged in.",AccType,pname);
                
SendClientMessageToAll(LIGHTBLUE,string);
                
SendClientMessageToAll(LIGHTBLUE,"{400000}______________________________________");
                }
                }
                else
                {
                    
AccInfo[playerid][FailLogin]++;
                    
printf("LOGIN: Failed Login: %s. Wrong password (%s) (%d)"PlayerName2(playerid), inputtextAccInfo[playerid][FailLogin] );
                    if(
AccInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
                    {
                    new 
string[128];
                    new 
adminname1[256];
                    
dini_Get("LuxAdmin/Config/Fail.ini",adminname1);
                    
SetPlayerName(playerid,adminname1);
                    
                    
format(stringsizeof(string), "[NGP]: Player %s has been automatically renamed to %s [Reason: Incorrect Password].",PlayerName2(playerid),adminname1);
                    
SendClientMessageToAll(redstring);
                    
format(stringsizeof(string), "[NGP]: %s has join the server.",adminname1);
                    
SendClientMessageToAll(redstring);
                    
                    if(
InClassSelection[playerid] == 1)
                    {
                    
InterpolateCameraPos(playerid,2213.6919,1423.1891,11.6544,2187.1863,1423.3636,11.6544,10000,CAMERA_MOVE);
                    
TextDrawHideForPlayer(playerid,LoadSc2);
                    
TextDrawHideForPlayer(playerid,LoadScp3);
                    
TextDrawHideForPlayer(playerid,LoadScp4);
                    
TextDrawHideForPlayer(playerid,LoadScp5);
                    
TextDrawHideForPlayer(playerid,LoadScp6);
                    
TextDrawHideForPlayer(playerid,LoadScp7);
                    
TextDrawHideForPlayer(playerid,LoadScp8);
                    
TextDrawShowForPlayer(playeridclassselection);
                    
TextDrawShowForPlayer(playeridclassselection1);
                    
TextDrawShowForPlayer(playeridclassselection2);
                    
TextDrawShowForPlayer(playeridclickhere);
                    
TextDrawShowForPlayer(playeridclassselection6);
                    
TextDrawShowForPlayer(playeridclassselection7);
                    
TextDrawShowForPlayer(playeridclassselection8);
                    
SelectTextDraw(playerid green);
                    
PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
                    }
                    
                 }
            }
        }
    } 
here is my code now tell me how i set this to guest account
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)