register problem
#1

Hi my register dialog input password show in OnPlayerConnect. How can I change it to OnPlayeSpawn?

Because when its in Onplayerconnect it covers the server intro. So it was very bad.
Reply
#2

I'm not sure what are you trying to ask.
Just move the ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, ...) line to under OnPlayerSpawn public...?
Reply
#3

Okay so I found it under

Код:
Onplayerconnect
ExistAccount(playerid);
and I moved it under OnplayerSpawn

....Here is what in side the existaccount

Код:
stock ExistAccount(playerid)
{
    #if USE_MYSQL == true
	new query[128];
	format(query, sizeof(query), "SELECT * FROM `"#MYSQL_TABLE"` WHERE `PlayerName` = '%s'", GetName(playerid));
	if(mysql_ping(gSQL))
	{
		mysql_query(query, _THREAD_ACCOUNT_EXIST, playerid, gSQL);
	}
	#else
	new file[128];
	format(file, sizeof(file), "/%s/%s.ini", DINI_PATH, GetName(playerid));
	if(dini_Exists(file))
	{
	    if(IsPlayerDiniBanned(playerid))
	    {
	        new string[128];
	        format(string, sizeof(string), ""red"Your account has been banned!"white"\n\nBanned by:\t %s\nReason:\t %s\nBan Date:\t %s", dini_Get(file, "BannedBy"), dini_Get(file, "BanReason"), dini_Get(file, "BanDate"));
			ShowPlayerDialog(playerid, BAN_DIALOG, DIALOG_STYLE_MSGBOX, " ", string, "OK", "");
			KickEx(playerid);
		}
		else
		{
		    #if USE_AUTO_LOGIN == true
		    new lastusedIP[16], IP[16];
		    GetPlayerIp(playerid, IP, sizeof(IP));
			format(lastusedIP, sizeof(lastusedIP), "%s", dini_Get(file, "LastIP"));
		    if(!strcmp(IP, lastusedIP, true))
		    {
		        SendClientMessage(playerid, GREEN, "SERVER: You will get auto logged in now");
		        LoadPlayer(playerid);
		        LogPlayerIn(playerid);
		        SendClientMessage(playerid, GREEN, "You have been automatically logged in");
		    }else ShowPlayerLoginDialog(playerid);
		    #else
			ShowPlayerLoginDialog(playerid);
			#endif
		}
	}
	else
	{
	    ShowPlayerRegisterDialog(playerid);
	}
	#endif
	return 1;
}
So the question is. Do you think when I put this ExistAccount OnPlayerSpawn it will have a problem or conflict wtih ban?
Reply
#4

It will have if you don't fix it. It's going to check if the account exists everytime a player re-spawns.

Honestly though, using it in OnPlayerSpawn seems very bad. Just set a timer after few seconds a player connects to show the dialog. Until the timer will be called, OnPlayerRequestClass would normally have been called.
Reply
#5

Quem pode me ajudar com esses erros?\/ contato skype: Lunatico-x



erros C:\Users\Conta_000\Desktop\egoporgem.pwn(2197) : error 017: undefined symbol "Now"
C:\Users\Conta_000\Desktop\egoporgem.pwn(2199) : error 017: undefined symbol "Now"
C:\Users\Conta_000\Desktop\egoporgem.pwn(223 : error 017: undefined symbol "Now"
C:\Users\Conta_000\Desktop\egoporgem.pwn(2240) : error 017: undefined symbol "Now"
C:\Users\Conta_000\Desktop\egoporgem.pwn(17873) : error 017: undefined symbol "Now"
C:\Users\Conta_000\Desktop\egoporgem.pwn(17895) : error 017: undefined symbol "Now"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It will have if you don't fix it. It's going to check if the account exists everytime a player re-spawns.

Honestly though, using it in OnPlayerSpawn seems very bad. Just set a timer after few seconds a player connects to show the dialog. Until the timer will be called, OnPlayerRequestClass would normally have been called.
kons I tried to put ExitAccount under OnPlayerRequestSpawn everytime I choose a character or the ">" its show "You have been successfully created!" again and again (very bad idea)


So konst can you please help me make a timer, where the register dialog show first before the server intro?


here's the intro I used http://pastebin.com/bxJPPg7E


and here are some important things to show the dialog
Код:
stock ShowPlayerRegisterDialog(playerid)
{
	new string[256];
	format(string, sizeof(string), ""white"Welcome to "blue""#SERVER_NAME""white","gold"\n"white"Your    name "gold" %s "white"is not registered.\n\nPlease enter a password for your new account:", GetName(playerid), GetName(playerid));
        ShowPlayerDialog(playerid, REGISTER_DIALOG, DIALOG_STYLE_PASSWORD, "Registration", string, "Register", "");
         return 1;
}
EDIT: Kons is it possible, let say after I enter my desired password and hit Register. Then the intro will start?
Reply
#7

Quote:
Originally Posted by kbalor
Посмотреть сообщение
kons I tried to put ExitAccount under OnPlayerRequestSpawn everytime I choose a character or the ">" its show "You have been successfully created!" again and again (very bad idea) [..]
I didn't mean IN the callback, a timer that until the time OnPlayerRequestClass will be called (5 seconds after a player connects).

So set a timer when a player connects with repeat to false and after 5 seconds it will check if the account exists.

EDIT: Yes, it is.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I didn't mean IN the callback, a timer that until the time OnPlayerRequestClass will be called (5 seconds after a player connects).

So set a timer when a player connects with repeat to false and after 5 seconds it will check if the account exists.

EDIT: Yes, it is.
Yes I understand now. I just make try.

Can you please help me how? I really need it. please!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)