Posts: 1,018
Threads: 320
Joined: Jul 2010
Hello everywone i have a problem so my friend is on the server and i loggin in and login dialog doesn't show me when someone on the server when I'm alone on the server then works. I mean show me the dialog for login, and when someone is on the server, and I'm going then I do not show the login dialog.
Posts: 100
Threads: 6
Joined: Mar 2012
Reputation:
0
Please post the code of the part where it should show the dialog
Posts: 1,018
Threads: 320
Joined: Jul 2010
So I worked Yini system save and load a player's variables here are part of the OnPlayerConnect di watching whether the player or not Regan
first I give you a part from onplayerconnect public
Quote:
if(fexist(Path(playerid)))
{
ShowLogin(playerid);
}
else
{
ShowIntro(playerid);
TextDrawShowForPlayer(playerid,crni);
SetPlayerColor(playerid,COLOR_GRAD2);
return 1;
}
|
then showlogin
showlogin shows that if a player is regan to switch ga ga over there or to switch to the login part
you will see login state that is where show dialog login. Sorry for my bad english
Quote:
stock ShowLogin(playerid)
{
if(IsPlayerConnected(playerid))
{
SetPVarInt(playerid, "loginstate", 1); //INTRO 1.
}
return 1;
}
//-----------------------[ LOGIN STATE ]-----------------------------------------//
public LoginCheck(playerid) {
for(new i=0;i<MAX_PLAYERS;i++) {
if(IsPlayerConnected(i) && GetPVarInt(i, "loginstate") != 0) {
if(GetPVarInt(i, "loginstate") == 1) {
SetTimerEx("PostaviKameru",1000,false,"d",i);
new name[MAX_PLAYER_NAME],loginstring[512];
GetPlayerName(i,name,sizeof(name));
KillTimer(IntroLogin[playerid]);
INI_ParseFile(Path(i),"loadaccount_%s", .bExtra = true, .extra = i);
format(loginstring,sizeof(loginstring),"{00C0FF}__ ___________________________________\n\n{FFFFFF}Dob rodošao na G-Unit RolePlay/Dm Server! {00C0FF}\n\n%s\n{FFFFFF}Vas je korisnicki racun pronadjen!\n\nMolimo upisi lozinku da udjes na server:\n{00C0FF}_________________________________ ______",name);
ShowPlayerDialog(i,dlogin,DIALOG_STYLE_PASSWORD,"P rijava",loginstring,"Logiraj","Izlaz"); } } } //}
|
return 1;
}
Posts: 1,018
Threads: 320
Joined: Jul 2010