Anti spawn dialog ???? -
kalanerik99 - 17.04.2015
Hi everyone how to make that it wont show spawn(for request class) until he wont login/register when he connects??
Код:
public OnPlayerConnect(playerid)
{
bla bla bla
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_REGISTER)
{
gPlayerLogged[playerid] = 1;
//bla bla bla
}
if (dialogid == DIALOG_LOGIN)
{
//bla bla bla
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp)
{
//bla bla bla
}
else
{
gPlayerLogged[playerid] = 1;
//bla bla bla
if(!response) return Kick(playerid);
}
}
return 1;
}
function SetupPlayerForClassSelection(playerid)
{
new name[MAX_PLAYER_NAME], file[126];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PLAYERS, name);
if(fexist(file))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "{FF8040}Login!", "{FF0000}Welcome back!\n {44FF00}Please login.", "Login", "Leave");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FF8040}Register", "{FF0000}Welcome!\n You are new here!\n {44FF00}Please register", "Register", "Leave");
}
}
Re: Anti spawn dialog ???? -
Infamous - 18.04.2015
Just block onplayerrequestspawn until they are logged in.
https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn
Either that or just create your own class selection screen.
Re: Anti spawn dialog ???? -
kalanerik99 - 18.04.2015
Please read everything I posted before you say.
Please anyone help me
LIKE THIS
Re: Anti spawn dialog ???? -
kalanerik99 - 18.04.2015
Please help
Re: Anti spawn dialog ???? -
Smileys - 18.04.2015
eh so you want a dialog to popup before they select their skin? or ??
Re: Anti spawn dialog ???? -
kalanerik99 - 18.04.2015
No before the BUTTONS FOR ([<<] [>>] [SPAWN]) SHOW
Re: Anti spawn dialog ???? -
JaKe Elite - 18.04.2015
That is nearly impossible.
In some occasions the dialog might delay and the arrows will appear first.
( this is an opinion only ) I don't think there is anyway to make the dialog appear first than these buttons. On some occasions you might find the dialog appearing first before the button, and in some situations, the buttons might appear first (depending on how the client's PC/net loads - OPINION ONLY)
Re: Anti spawn dialog ???? -
kalanerik99 - 18.04.2015
LOOOKKKKK AT THE PICTURE I POSTED
Re: Anti spawn dialog ???? -
JaKe Elite - 18.04.2015
Do you know how to read? We are trying to help you, and you are showing us your attitude? Seriously dude?
Learn to read next time, let me re-post the lines where in I explain the thing you are trying to do.
"( this is an opinion only ) I don't think there is anyway to make the dialog appear first than these buttons. On some occasions you might find the dialog appearing first before the button, and in some situations, the buttons might appear first (depending on how the client's PC/net loads - OPINION ONLY)"
If you keep the attitude you had right now, there's no one who will help you.
Re: Anti spawn dialog ???? -
kalanerik99 - 18.04.2015
oooh you helped me soo much now =(