Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 18.08.2011
Quote:
Originally Posted by 0_o
You Mean... /me RightClicks And Creates New Folder ***End*** That's What You Mean?
|
PHP Code:
/me RightClicks And Creates New Folder 'Users'.
Re: Login and Register System - Dialogs - Using Y_INI -
0_o - 18.08.2011
Quote:
Originally Posted by Kush
PHP Code:
/me RightClicks And Creates New Folder 'Users'.
|
Done, Nothing Happened. Still The Same!
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 18.08.2011
Quote:
Originally Posted by 0_o
Done, Nothing Happened. Still The Same!
|
Download the Full Package, grab your includes and place them in the pawno>include folder. Other FS/Plugins needed and then place your script into the gamemode folder. Change some details in the .cfg and then ur good to go I guess.
Re: Login and Register System - Dialogs - Using Y_INI -
0_o - 18.08.2011
Quote:
Originally Posted by Kush
Download the Full Package, grab your includes and place them in the pawno>include folder. Other FS/Plugins needed and then place your script into the gamemode folder. Change some details in the .cfg and then ur good to go I guess.
|
Downloaded Full Package and runned The Server. Doesn't Work
Re: Login and Register System - Dialogs - Using Y_INI -
ElieJabbour - 18.08.2011
And you call yourself, a bad scripter..
Great Job, Man
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 18.08.2011
Quote:
Originally Posted by ElieJabbour
And you call yourself, a bad scripter..
Great Job, Man
|
Thanks man
Re: Login and Register System - Dialogs - Using Y_INI -
Wesley221 - 20.08.2011
How would i load a string into a variable?
With an integer you do it like "INI_Int();", and with a string ?
I tried INI_String();, but then i get the error Undefined symbol INI_String();
Thanks!
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 20.08.2011
Quote:
Originally Posted by Wesley221
How would i load a string into a variable?
With an integer you do it like "INI_Int();", and with a string ?
I tried INI_String();, but then i get the error Undefined symbol INI_String();
Thanks!
|
I assume it works the same way as the way the password is stored. Though I've never worked around issues with loading strings.
Re: Login and Register System - Dialogs - Using Y_INI -
Admigo - 20.08.2011
Why if admin is ingame the other players are admin?
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 20.08.2011
What do you mean "other player are admins". If you're saying that other people can execute administrative commands, then it's your code.
Place this code within you script, create a new account and test it.
PHP Code:
YCMD:test(playerid, params[], help)
{
#pragma unused help
#pragma unused test
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You are not an Admin!");
SendClientMessage(playerid, -1, "You are indeed an Admin!");
return 1;
}
Re: Login and Register System - Dialogs - Using Y_INI -
Wesley221 - 20.08.2011
Quote:
Originally Posted by Kush
I assume it works the same way as the way the password is stored. Though I've never worked around issues with loading strings.
|
Because im trying to load a whirlpool hashed password, and since it also contains some letters, its an string. Think imma ask it in the y_ini topic then
Great tutorial btw
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 20.08.2011
Quote:
Originally Posted by Wesley221
Because im trying to load a whirlpool hashed password, and since it also contains some letters, its an string. Think imma ask it in the y_ini topic then
Great tutorial btw
|
Thanks but yea, it would work the same way.
Re: Login and Register System - Dialogs - Using Y_INI -
Henkie - 26.08.2011
It doesnt save my cash when i use /q.
The code is under the onplayerdisconnect function.
What to do?
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 26.08.2011
This is because you need to
GivePlayerMoney. Remember, the LoadUser_data function simply loads the values, but that doesn't mean it will give you your money, nor will it give you weapons if you don't tell it what to do.
Try something like this:
PHP Code:
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
return 1;
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(PlayerPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
OnPlayerLogin(playerid); //here
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
}
}
}
That would work.
Re: Login and Register System - Dialogs - Using Y_INI -
Henkie - 26.08.2011
Quote:
Originally Posted by Kush
This is because you need to GivePlayerMoney. Remember, the LoadUser_data function simply loads the values, but that doesn't mean it will give you your money, nor will it give you weapons if you don't tell it what to do.
Try something like this:
PHP Code:
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
return 1;
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(PlayerPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
OnPlayerLogin(playerid); //here
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
}
}
}
That would work.
|
That is not the answer for my question.
It does not save the money when I disconnect. The value does not change in the .ini file.
Thats the problem.
But i dunno how to fix it.
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 26.08.2011
Quote:
Originally Posted by [PC]henkie[NL]
That is not the answer for my question.
It does not save the money when I disconnect. The value does not change in the .ini file.
Thats the problem.
But i dunno how to fix it.
|
All I've read was 'Cash doesn't save'. My bad, but yea I've just re-downloaded the Full Download and it saves for me. What changes have you made?
Re: Login and Register System - Dialogs - Using Y_INI -
Henkie - 26.08.2011
Quote:
Originally Posted by Kush
All I've read was 'Cash doesn't save'. My bad, but yea I've just re-downloaded the Full Download and it saves for me. What changes have you made?
|
I added some variables like: pFaction, pSkin etc.
And didn't download yours, but I just copied the code from your first post.
I'll try to use your download later this day.
I can't do it now, because I'm using my mobile phone right now.
Re: Login and Register System - Dialogs - Using Y_INI -
SantarioLeone - 28.08.2011
HTML Code:
[C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 017: undefined symbol "pInfo"
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : warning 215: expression has no effect
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 001: expected token: ";", but found "]"
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 029: invalid expression, assumed zero
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
My errors are this and GREAT tutorial by the way. Im not sure where i went wrong but i followed it step by step.
Re: Login and Register System - Dialogs - Using Y_INI -
Kush - 28.08.2011
Quote:
Originally Posted by SantarioLeone
HTML Code:
[C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 017: undefined symbol "pInfo"
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : warning 215: expression has no effect
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 001: expected token: ";", but found "]"
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : error 029: invalid expression, assumed zero
C:\Users\Tab\Desktop\Los Santos RolePlay\Los Santos RolePlay\gamemodes\Scratch.pwn(61) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
My errors are this and GREAT tutorial by the way. Im not sure where i went wrong but i followed it step by step.
|
Thanks and show the code.
Re: Login and Register System - Dialogs - Using Y_INI -
SantarioLeone - 28.08.2011
HTML Code:
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",pInfo[playerid][pPass]); //line 61
INI_Int("Cash",pInfo[playerid][pCash]);
INI_Int("Admin",pInfo[playerid][pAdmin]);
INI_Int("Kills",pInfo[playerid][pKills]);
INI_Int("Deaths",pInfo[playerid][pDeaths]);
return 1;
}
HTML Code:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}
new pInfo[MAX_PLAYERS][pInfo];