30.03.2016, 11:04
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
plz tell me some example
new string [128];
format(string, sizeof(string), "guestaccount_%d", playerid);
SetPlayerName(playerid, string);
Do you have anything that shows the dialog or message when they get the password wrong?
Try this pawn Код:
|
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(buf, sizeof(buf), inputtext);
if(strcmp(Pass, buf, false) == 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(playerid, pname, sizeof(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(playerid, classselection);
TextDrawShowForPlayer(playerid, classselection1);
TextDrawShowForPlayer(playerid, classselection2);
TextDrawShowForPlayer(playerid, clickhere);
TextDrawShowForPlayer(playerid, classselection6);
TextDrawShowForPlayer(playerid, classselection7);
TextDrawShowForPlayer(playerid, classselection8);
SelectTextDraw(playerid , green);
PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
}
if(AccInfo[playerid][pVip] > 0)
{
switch(AccInfo[playerid][pVip])
{
case 1: AccType = "{808000}Bronze_Vip";
case 2: AccType = "{FFFFFF}Silver_Vip";
case 3: AccType = "{FF8000}Golden_Vip";
}
SendClientMessageToAll(LIGHTBLUE,"{400000}______________________________________");
format(string, sizeof(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), inputtext, AccInfo[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(string, sizeof(string), "[NGP]: Player %s has been automatically renamed to %s [Reason: Incorrect Password].",PlayerName2(playerid),adminname1);
SendClientMessageToAll(red, string);
format(string, sizeof(string), "[NGP]: %s has join the server.",adminname1);
SendClientMessageToAll(red, string);
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(playerid, classselection);
TextDrawShowForPlayer(playerid, classselection1);
TextDrawShowForPlayer(playerid, classselection2);
TextDrawShowForPlayer(playerid, clickhere);
TextDrawShowForPlayer(playerid, classselection6);
TextDrawShowForPlayer(playerid, classselection7);
TextDrawShowForPlayer(playerid, classselection8);
SelectTextDraw(playerid , green);
PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
}
}
}
}
}