SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 04/08/2016, 01:19 PM   #521
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Login and Register System - Dialogs - Using Y_INI

Quote:
Originally Posted by Oracle1997 View Post
forum link for Y_ini is dead
Check the post above the post above you.
Stinged is offline   Reply With Quote
Old 05/08/2016, 02:37 PM   #522
Mitchyjones
Little Clucker
 
Join Date: May 2014
Posts: 8
Reputation: 0
Default Re: Login and Register System - Dialogs - Using Y_INI

Quote:
Originally Posted by Mitchyjones View Post
It doesn't seem to save anything when I relog, whys this? Do you have a fix for it?

I'll be monitoring this more often.
Still waiting ^
__________________
Ezi Royal - San Andreas Roleplay - Probationary Administrator
Mitchyjones is offline   Reply With Quote
Old 21/08/2016, 10:03 PM   #523
Gorgeousmaniac
Big Clucker
 
Gorgeousmaniac's Avatar
 
Join Date: Aug 2016
Location: Philippines
Posts: 100
Reputation: 16
Default Re: Login and Register System - Dialogs - Using Y_INI

Thank you so much +rep
Gorgeousmaniac is offline   Reply With Quote
Old 09/12/2016, 07:44 AM   #524
AvicennaRabama
Little Clucker
 
Join Date: Jan 2015
Location: Indonesia
Posts: 20
Reputation: 0
Default Re: Login and Register System - Dialogs - Using Y_INI

I did all of the step that guided. But, look at this. I don't know why, Can anyone give the reason why is this? And the way for fix it?
Code:
E:\samp037_svr_R2-1-1_win32\gamemodes\new.pwn(107) : error 001: expected token: "-string end-", but found "-identifier-"
E:\samp037_svr_R2-1-1_win32\gamemodes\new.pwn(107) : error 001: expected token: "-string end-", but found "-identifier-"
E:\samp037_svr_R2-1-1_win32\gamemodes\new.pwn(107) : warning 215: expression has no effect
E:\samp037_svr_R2-1-1_win32\gamemodes\new.pwn(107) : error 001: expected token: ";", but found "-integer value-"
E:\samp037_svr_R2-1-1_win32\gamemodes\new.pwn(107) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Thanks!
AvicennaRabama is offline   Reply With Quote
Old 24/03/2017, 03:33 AM   #525
ThomasEvil
Big Clucker
 
Join Date: Jun 2016
Posts: 153
Reputation: 0
Default Re: Respuesta: Login and Register System - Dialogs - Using Y_INI

Quote:
Originally Posted by JuanStone View Post
I see nothing about reset variables, that might be the problem, do it and perhaps already don't have more problems with this.

PHP Code:
public OnPlayerConnect(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
//..
    
if(fexist(Path(playerid)))
    {
        
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra true, .extra playerid)
        
//..
        
if(pInfo[playerid][Banned] == || pInfo[playerid][oBanned] == 1)
        {
            
SendClientMessage(playerid,COLOR_RED,"[INFO] Your account is currently suspended from this server");
            
SetTimerEx("DelayedKick"500false"d"playerid);
        }
        else 
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT"Mickey's: Simply TDM""This account is registered,\nplease insert your password below""Login""Exit");
    }
    else if(!
fexist(Path(playerid)))
    {
        
pInfo[playerid][Adminlevel] = 0;
        
pInfo[playerid][VIPlevel] = 0;
        
// restart all variables per player..
        
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Mickey's: Simply TDM","Welcome, this username is available!\nEnter a password below to register it","Register""Exit");
    }
    return 
true;

Hello, i don't understand you at all... I really need to solve it what can i do please?
What should i put in this code to work right? Problem: New registered player got stats of last connected player...
ThomasEvil is offline   Reply With Quote
Old 24/03/2017, 05:53 AM   #526
Variable™
Gangsta
 
Variable™'s Avatar
 
Join Date: Jul 2015
Posts: 823
Reputation: 200
Default Re: Login and Register System - Dialogs - Using Y_INI

Y_Ini is pretty much outdated, start learning SQLite or MySQL.
__________________
Need a game server? Contact me for information.
Variable™ is offline   Reply With Quote
Old 30/03/2017, 10:41 AM   #527
FreakyTeddyKiller
Little Clucker
 
Join Date: Sep 2016
Posts: 2
Reputation: 0
Question Re: Login and Register System - Dialogs - Using Y_INI

Hello, I am a very new SAMP developer and I am trying to make my first server, thanks for this code, But I'm having a problem, When I try to compile my file, an error appears, and that is:
"fatal error 100: cannot read from file: "YSI/y_ini". How do I fix this error, I have checked that this file exists. Please help.
FreakyTeddyKiller is offline   Reply With Quote
Old 30/03/2017, 11:15 AM   #528
FreakyTeddyKiller
Little Clucker
 
Join Date: Sep 2016
Posts: 2
Reputation: 0
Default Re: Login and Register System - Dialogs - Using Y_INI

Now, I've fixed that problem so I'm having a new damn problem and that is:

G:\GTA SA MODS\samp037_svr_R2-1-1_win32\pawno\include\YSI/y_ini.inc(162) : fatal error 100: cannot read from file: "internal\y_version"
1 Error.
FreakyTeddyKiller is offline   Reply With Quote
Old 03/04/2017, 07:22 PM   #529
KizZweLL
Little Clucker
 
KizZweLL's Avatar
 
Join Date: Jan 2016
Location: Philippines
Posts: 26
Reputation: 0
Default Re: Login and Register System - Dialogs - Using Y_INI

The script is good, but when i try to register and /q then login it says that the password is incorrect.
how to fix this?

Quote:
//include
#include <a_samp>
#include <YSI\y_ini>
#include <sscanf2>
//PATH
#define PATH "/Users/%s.ini"
//colors
#define White "{FFFFFF}"
#define Red "{FF0000}"
//DIALOG
#define LOGIN 1
#define REGISTER 2
#define SUCCESS 3
//enum
enum Info
{
Password,
Admin,
Cash,
Kills,
Deaths,
Score,
Color,
}
new PlayerInfo[MAX_PLAYERS][Info];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][Password]);
INI_Int("Admin",PlayerInfo[playerid][Admin]);
INI_Int("Cash",PlayerInfo[playerid][Cash]);
INI_Int("Kills",PlayerInfo[playerid][Kills]);
INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
INI_Int("Score",PlayerInfo[playerid][Score]);
INI_Int("Color",PlayerInfo[playerid][Color]);
return 1;
}
//stock
stock UserPath(playerid)
{
new string[128],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),PATH,Name);
return string;
}
stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
return Name;
}
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}LOGIN...", "{FFFFFF}Please Enter Your Password Below to Login.", "Login", "");
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "{FFFFFF}REGISTER...", "{FFFFFF}Please Enter Password To Register.", "Register", "");
}
return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Stats");
INI_WriteInt(File,"Admin",PlayerInfo[playerid][Admin]);
INI_WriteInt(File,"Cash",PlayerInfo[playerid][Cash]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",PlayerInfo[playerid][Score]);
INI_WriteInt(File,"Color",PlayerInfo[playerid][Color]);
INI_Close(File);
INI_Close(File);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "{FFFFFF}REGISTER...", "{FFFFFF}Please Enter Password To Register.", "Register", "");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Stats");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Color",0);
INI_Close(File);
ShowPlayerDialog(playerid, SUCCESS, DIALOG_STYLE_MSGBOX, "{00FF00}Success!!!", "{FF61FF}You Have Successfully Registered!", "Okay", ""); INI_Close(File);
SpawnPlayer(playerid);
}
}

case LOGIN:
{
if (!response) return Kick ( playerid );
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerScore(playerid,PlayerInfo[playerid][Score]);
ShowPlayerDialog(playerid, SUCCESS, DIALOG_STYLE_MSGBOX, "{00FF00}Success!!!", "{FF61FF}You Have Successfully Logged in!", "Okay", "");
}
else
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login!", "{FF0000}You Have Entered An Invalid Password\n{FF0000}Please Re-enter Your Password Below.", "Okay", "");
}
return 1;
}
}
}
return 1;
}
__________________
Sometimes impossible can turn into reality.
KizZweLL is offline   Reply With Quote
Old 27/04/2017, 10:04 PM   #530
ShaharG
Banned
 
Join Date: Apr 2017
Posts: 14
Reputation: 5
Default Re: Login and Register System - Dialogs - Using Y_INI

very nice scrip, thats will help for begginers
ShaharG is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Login & Register system - dialogs - with y_ini Seven_of_Nine Tutorials 30 01/11/2018 10:54 AM
[FilterScript] [FS] ERegLog ( Advanced Register/Login System [Dialogs] ) aircombat Filterscripts 29 09/11/2014 09:30 PM
[Tutorial] Login and Register System - Dialogs - Using SII Kush Tutorials 69 02/07/2013 05:19 PM
[FilterScript] Register/login system (Dini, dialogs) pantelimonfl Filterscripts 6 08/03/2011 04:13 PM


All times are GMT. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.