Posts: 366
Threads: 113
Joined: Feb 2014
Hello , I want to Save the all the player data and store its detail in a file . If the player is not registered a Message Dialog appears for registration and if he/she is registered so he can simple login by his/her password . Please give me a simple command so that i can do changed e.g. I wanna edit "Enter password to register" to "Your account in not registered you can enter password to register your account ".
Posts: 617
Threads: 129
Joined: Feb 2014
Then you want to make a register system here is a tutorial.
https://sampforum.blast.hk/showthread.php?tid=352703
Posts: 366
Threads: 113
Joined: Feb 2014
Quote:
Originally Posted by 1fret
|
I tried this but i am facing problem after i enter this cmd
PHP код:
/*OnPlayerConnect will be called when players is connected to your server. So now we will need to show a register or login dialog*/
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
GetPlayerName(playerid,name,sizeof(name)); //Get player's name
if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
{// then
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
}
else //If the connected user is not registered,
{//then we will 'force' him to register :)
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
return 1;
}
return 1;
}
When i try to Compile it says "Undefined Symbol : "Path"
But i already pasted this command
PHP код:
stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
new str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),UserPath,name);
return str;
}
Posts: 617
Threads: 129
Joined: Feb 2014
You need to define the path were it should be saved.
pawn Код:
#define PATH" Users/%s.ini"
Thanks dude edited it.Cause I'm using my phone
Posts: 366
Threads: 113
Joined: Feb 2014

After i added the registration system i am facing this problem.
Posts: 617
Threads: 129
Joined: Feb 2014
Dude go to scriptfiles/propeties/ and create some txt(notepad ) file call them houses,police,banks etc......cause it can't read from a file that's missing that's if you don't have them already. If you do have them well something is messing from them so it can't read
Posts: 366
Threads: 113
Joined: Feb 2014
houses , police and banks are already created in scriptfiles/properties
Posts: 617
Threads: 129
Joined: Feb 2014
Try getting the original to replace the old one's