18.08.2011, 22:11
[Tutorial] Login and Register System - Dialogs - Using Y_INI
18.08.2011, 22:14
18.08.2011, 22:16
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.
18.08.2011, 22:36
Downloaded Full Package and runned The Server. Doesn't Work
18.08.2011, 23:33
And you call yourself, a bad scripter..
Great Job, Man
Great Job, Man
18.08.2011, 23:55
20.08.2011, 13:21
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!
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!
20.08.2011, 13:44
I assume it works the same way as the way the password is stored. Though I've never worked around issues with loading strings.
20.08.2011, 14:14
Why if admin is ingame the other players are admin?
20.08.2011, 14:27
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.
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;
}
20.08.2011, 14:36
Quote:
I assume it works the same way as the way the password is stored. Though I've never worked around issues with loading strings.
|
Great tutorial btw
20.08.2011, 15:02
26.08.2011, 06:58
It doesnt save my cash when i use /q.
The code is under the onplayerdisconnect function.
What to do?
The code is under the onplayerdisconnect function.
What to do?
26.08.2011, 10:06
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:
That would work.
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");
}
}
}
26.08.2011, 10:16
Quote:
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:
|
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.
26.08.2011, 10:28
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?
26.08.2011, 10:49
Quote:
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?
|
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.
28.08.2011, 16:41
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.
28.08.2011, 16:42
Quote:
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. |
28.08.2011, 16:48
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];
« Next Oldest | Next Newest »
Users browsing this thread: 3 Guest(s)