SA-MP Forums Archive
Whats wrong? :S - 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: Whats wrong? :S (/showthread.php?tid=258136)



Whats wrong? :S - Markx - 29.05.2011

Well, i connect to my server and the dialog doesnt show.. Also i got the Users folder created..

pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerCash(playerid);
   
    TextDrawHideForPlayer(playerid, Textdraw_team);
    TextDrawHideForPlayer(playerid, Textdraw_weaps);

    TogglePlayerSpectating(playerid, 1);
    IsLogged[playerid] = 0;

    new file[128], string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    if(!fexist(file))
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome to "Red"Future Freedom "White"\nPlease write a password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, ""Red"Account Registration", string, "Register", "Leave");
    }
    if(fexist(file))
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome back to "Red"Future Freedom "White"\nPlease write your password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, ""Red"Account Login", string, "Login", "Leave");
    }
    return 1;
}
I tryd to replace if(!fexist(file)) with if(IsLogged[playerid] == 0) but its still the same..
Help please.

Regards,
Markx.


Re: Whats wrong? :S - alpha500delta - 29.05.2011

Try using "else" instead of "if(fexist(file))"

That works with me as my system is nearly the same.


Re: Whats wrong? :S - Markx - 29.05.2011

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Try using "else" instead of "if(fexist(file))"

That works with me as my system is nearly the same.
Again nothing


Re: Whats wrong? :S - [L3th4l] - 29.05.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerCash(playerid);
    print("Reset Cash Done");

    TextDrawHideForPlayer(playerid, Textdraw_team);
    TextDrawHideForPlayer(playerid, Textdraw_weaps);
    print("Textdraw Hide Done");

    TogglePlayerSpectating(playerid, 1);
    IsLogged[playerid] = 0;
    print("Toggle, and Islogged Done");

    new file[128], string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    print("File info done");

    if(!fexist(file))
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome to "Red"Future Freedom "White"\nPlease write a password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, ""Red"Account Registration", string, "Register", "Leave");
    }
    else
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome back to "Red"Future Freedom "White"\nPlease write your password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, ""Red"Account Login", string, "Login", "Leave");
    }
    print("OnPlayerConnect was successful");
    return 1;
}
Try that, also, let me know what prints when you start the server.


Re: Whats wrong? :S - Markx - 29.05.2011

Everything was printed but the dialog didnt show, wtf! Also the file isnt created in my Users folder O.o


Re: Whats wrong? :S - Finn - 29.05.2011

Maybe try putting this under OnPlayerRequestClass.


Re: Whats wrong? :S - Toreno - 29.05.2011

It doesn't matter where he places it, maybe it's something else.
Try this and respond back if it shows you the dialog, if so... something is messed up with your code.
pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerCash(playerid);
    print("Reset Cash Done");
   
    TextDrawHideForPlayer(playerid, Textdraw_team);
    TextDrawHideForPlayer(playerid, Textdraw_weaps);
    print("Textdraw Hide Done");

    TogglePlayerSpectating(playerid, 1);
    IsLogged[playerid] = 0;
    print("Toggle, and Islogged Done");

    /*new file[128], string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    print("File info done");

    if(!fexist(file))
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome to "Red"Future Freedom "White"\nPlease write a password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, ""Red"Account Registration", string, "Register", "Leave");
    }
    else
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome back to "Red"Future Freedom "White"\nPlease write your password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, ""Red"Account Login", string, "Login", "Leave");
    }*/

    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Testing DIALOG", "Blah.. Blah...", "OK", "CANCEL");
    print("OnPlayerConnect was successful");
    return 1;
}



Re: Whats wrong? :S - Markx - 29.05.2011

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
It doesn't matter where he places it, maybe it's something else.
Try this and respond back if it shows you the dialog, if so... something is messed up with your code.
pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerCash(playerid);
    print("Reset Cash Done");
   
    TextDrawHideForPlayer(playerid, Textdraw_team);
    TextDrawHideForPlayer(playerid, Textdraw_weaps);
    print("Textdraw Hide Done");

    TogglePlayerSpectating(playerid, 1);
    IsLogged[playerid] = 0;
    print("Toggle, and Islogged Done");

    /*new file[128], string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/Users/%s.ini",name);
    print("File info done");

    if(!fexist(file))
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome to "Red"Future Freedom "White"\nPlease write a password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, ""Red"Account Registration", string, "Register", "Leave");
    }
    else
    {
        format(string, sizeof string, ""Blue"Hello %s!\n\n"Green"[System]"White" Welcome back to "Red"Future Freedom "White"\nPlease write your password below:", GetName(playerid));
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, ""Red"Account Login", string, "Login", "Leave");
    }*/

    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Testing DIALOG", "Blah.. Blah...", "OK", "CANCEL");
    print("OnPlayerConnect was successful");
    return 1;
}
That works.

EDIT: Fixed! It was the #define Register and login, i put it on 1 and 2 and it works now!

Thanks to all.