|
|
#1 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Australia
Posts: 4,038
Reputation: 835
|
New tutorial, now using up-to-date methods!
It's strongly suggested that everyone takes a look at this tutorial, help will be ignored and so will the thread be locked. The tutorial is clearly out-dated. ________________________________________ Register system in Dialog By Lorenc So what is this? Its a tutorial about how to make a register system in dialog. I made this because i found one which was abit faulty and to be honest in my opinion it was crap. In this tutorial I will explain most of it. Starting Ok in order to make this we will need 2 includes. Dini & Dudb. pawn Code:
pawn Code:
pawn Code:
Scripting Great we're on the 2nd step now! so we got our Dudb & Dini working, lets get ready for the real scripting .pawn Code:
You might get one warning but tho it will be gone throughout scripting. Next we will need to make gPlayerLogged, that means if the player is logged or not. pawn Code:
and the last define is the userfile, where the userfile will be. pawn Code:
___ Lets move to the onplayer connect callback Add these codes to the call back. pawn Code:
^ what this does is that you connects you as a not logged in person and shows a dialog for if your logged or not logged. next we have to go to the OnPlayerDisconnect Callback and put: pawn Code:
^What that will do for us is save our new status in-game plus it logs you out. Dialogs We are up to making to dialogs configure now! ![]() so lets start off with the register dialog. Navigate to OnDialogResponse which is at the bottom of the script usally and add this code. pawn Code:
^ That configures the dialog we've got for the register Now lets press enter at the end of the dialog 1 (register). Below it paste: pawn Code:
^ That configures the dialog we've got for the login Summary There you go you've just got a dialog reg/log system. You can now claim it as yours and edit it. Well done. Please note if i made a lil error tell me, i was acctaully trying to get the codes outta my gm. I hope i didnt fail something. If i did, tell me ill fix it. Credits Lorenc - Mostly creating TUT & Script parts. -Rebel Son- - Got some codes off him. Dracoblue - DINI & Dudb SAMP for their new gui. Download for the pwn http://pastebin.com/Ygy5z1d8 Bugs bugs bugs, tell me if there is one, ill try my hardest to fix it. If i made mistakes in this tut tell me soz for awful englishLast edited by Lorenc_; 03/11/2011 at 05:13 AM. |
|
|
|
|
#2 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2008
Posts: 3,748
Reputation: 1335
|
For the saving part, I suggest you to use "if(gPlayerLogged[playerid] == 1)", instead of "if(fexists(file)), so the account won't save when somebody else then the original player joins the server under that name.
|
|
|
|
|
#3 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Australia
Posts: 4,038
Reputation: 835
|
|
|
|
|
|
#4 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2009
Posts: 1,602
Reputation: 61
|
More detail would be better :X
|
|
|
|
|
#5 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2010
Posts: 220
Reputation: 6
|
Nice tutorial
|
|
|
|
|
#6 |
|
Big Clucker
![]() ![]() Join Date: May 2009
Posts: 122
Reputation: 1
|
Stats don't save please help
|
|
|
|
|
#7 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Australia
Posts: 4,038
Reputation: 835
|
|
|
|
|
|
#8 | |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Australia
Posts: 4,038
Reputation: 835
|
Sorry for this awful double post
You sure you've added the stuff on onplayerdisconnect, else if you did Quote:
Admin scripts might disturb its saving. |
|
|
|
|
|
#9 |
|
Big Clucker
![]() ![]() Join Date: May 2009
Posts: 122
Reputation: 1
|
This is my OnPlayerDisconect
Code:
public OnPlayerDisconnect(playerid, reason)
{
//--------------------------------------------------------------------------
new String[128];
new PName[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
}
gPlayerLogged[playerid] = 0;
switch(reason)
{
case 0: format(String, sizeof(String), "%s a lost the connection with server(Crash).", PName);
case 1: format(String, sizeof(String), "%s quit the server(Quit).", PName);
case 2: format(String, sizeof(String), "%s quit the server. (Kicked)", PName);
}
return 1;
}
|
|
|
|
|
#10 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2008
Posts: 3,748
Reputation: 1335
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Help] Register/Login System with DIALOG | BMGP | Help Archive | 5 | 14/12/2010 05:34 PM |
| Changeing A Register System To Dialog | robert4049 | Help Archive | 2 | 14/07/2010 08:53 PM |
| How to make Register script with a dialog? | GangsTa_ | Help Archive | 6 | 30/05/2010 05:07 AM |
| Dialog Register System | SlashPT | Help Archive | 3 | 08/01/2010 11:02 AM |
| How to make login/register system with DIALOG? | juseong111 | Help Archive | 3 | 20/10/2009 01:20 PM |