Help , Auto Login
#1

can anyone help me please , after you /register and /q , then login again
enter wrong password , auto login

public OnPlayerConnect(playerid)
{
if (udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][LoggedIn] == 0)
{
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, "Login","This account is registered !login please","Login","Kick");
}
}
if (!udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][Registered] == 0)
{
new string[200];
format(string, sizeof(string),""cwhite"Welcome To COD - TDM V3.1 "cred"%s "cwhite"You are not Registered\nPlease Enter a password to register an account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
}
}
if(PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Money", 0);
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
else
{
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
}
Reply
#2

Bump , help me please
Reply
#3

This code isn't enough.
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
if (udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][LoggedIn] == 0)
{
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, "Login","This account is registered !login please","Login","Kick");
}
}
else if (!udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][Registered] == 0)
{
new string[200];
format(string, sizeof(string),""cwhite"Welcome To COD - TDM V3.1 "cred"%s "cwhite"You are not Registered\nPlease Enter a password to register an account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
}
}
else if(PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Money", 0);
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
else
{
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
Try this
Reply
#5

still auto login -,-
Reply
#6

Show OnPlayerSpawn
Reply
#7

public OnPlayerSpawn(playerid)
{
if(Synching[playerid] == true)
{
Synching[playerid] = false;
SetPlayerHealth(playerid,sHP[playerid]);
SetPlayerArmour(playerid,sAP[playerid]);
GivePlayerMoney(playerid, 100000);
SetPlayerPos(playerid,sPos[playerid][0],sPos[playerid][1],sPos[playerid][2]);
setskin(playerid);
SendClientMessage(playerid,green,"You Have Synced!");
ResetPlayerWeapons(playerid);
for(new slot; slot < 13; slot ++)
{
GivePlayerWeapon(playerid,sWeap[playerid][slot],sAmmo[playerid][slot]);
}
return 1;
}

SetPlayerHealth(playerid, 99999.0);
SetTimerEx("SpawnProtection", 10000, false, "i", playerid);
SendClientMessage(playerid, red, "*Anti-Spawn kill protection for 10 seconds!");
AntiSK[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
GivePlayerWeapons(playerid);
PlayerPlaySound(playerid, 1184, 2127.2194,2368.6323,10.8203); //Stop music
Update3DTextLabelText(DM[playerid], 0xFFFFFFFF, " ");
Update3DTextLabelText(Dis[playerid], 0xFFFFFFFF, " ");
UpdateLabelText(playerid);
TextDrawShowForPlayer(playerid, TeamText[playerid]);
TextDrawHideForPlayer(playerid, CountText[playerid]);
UpdateTextdraw(playerid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)