SA-MP Forums Archive
Login Almost Working - 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: Login Almost Working (/showthread.php?tid=208105)



Login Almost Working - dclaw - 07.01.2011

When i go into my server with a registered nickname is says to register.
When i go into my server with a un-registered is says the same.
But it most to do:
When im not registered ask me to register.
Otherwise let me login. But it doesnt.

My code:

Код:
public OnPlayerConnect(playerid)
{
    if (dini_Exists(udb_encode(playername)))
   	SendClientMessage(playerid,COLOR_RED,"Please login! Use /login [Password]");
   	else
   	SendClientMessage(playerid,COLOR_RED,"Ur not registered! Please use /register [Password]");
	logged[playerid] = 0;
	new name[MAX_PLAYER_NAME],string[32];
	SetPlayerColor(playerid, COLOR_PINK);
	GetPlayerName(playerid,name,sizeof(name));
	format(string,sizeof(string),"%s has joined the server",name);
	SendClientMessageToAll(COLOR_GREY,string);
	return 1;
}
Hope someone can fix it <3 (Im not gay)


Re: Login Almost Working - dclaw - 07.01.2011

Cant nobody fix it?
;(


Re: Login Almost Working - alpha500delta - 07.01.2011

Dude have patience not everyone can fix it in 1 second


Re: Login Almost Working - John_F - 07.01.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    if (dini_Exists(udb_encode(playername)))
    {
    SendClientMessage(playerid,COLOR_RED,"Please login! Use /login [Password]");
    }
    else SendClientMessage(playerid,COLOR_RED,"Ur not registered! Please use /register [Password]");
       
    logged[playerid] = 0;
    new name[MAX_PLAYER_NAME],string[32];
    SetPlayerColor(playerid, COLOR_PINK);
    GetPlayerName(playerid,name,sizeof(name));
    format(string,sizeof(string),"%s has joined the server",name);
    SendClientMessageToAll(COLOR_GREY,string);
    return 1;
}
You need brackets for if statements.


Still not working - dclaw - 08.01.2011

IT still gives the same message everytime.

Код:
public OnPlayerConnect(playerid)
{
	logged[playerid] = 0;    new name[MAX_PLAYER_NAME],string[32];
	SetPlayerColor(playerid, COLOR_PINK);
	GetPlayerName(playerid,name,sizeof(name));
	format(string,sizeof(string),"%s has joined the server",name);
	SendClientMessageToAll(COLOR_GREY,string);
	if (dini_Exists(udb_encode(playername)))
	{
	SendClientMessage(playerid,COLOR_RED,"Please login! Use /login [Password]");
	}
	else SendClientMessage(playerid,COLOR_RED,"Ur not registered! Please use /register [Password]");
	return 1;
}