Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PROJECT JFS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- PROJECT 'JFS'.
- SYSTEM LOGIN/REGISTER WITH RECOVERY PASSWORD VIA EMAIL AT DOF2 !!!!
- Skype: jonathanfeitosajfs
- MSN: jonathan_feitosa@hotmail.com.br
- Create By: JONATHAN FEITOSA
- DATE: 12/12/2012 *0*
- */
- #include <a_samp>
- #include <dof2>
- #include <a_http>
- #define MAILER_URL "geradoresjfs.site90.net/mailer.php" // Archive. Php> upe your <!
- #include <mailer>
- #define CONTAS \
- "PlayersJFS/%s.ini"
- #define REGISTRO \
- (787)
- #define LOGIN \
- (790)
- #define MAXPLAYERSJFS \
- (50) // Server Slots
- #define DinheiroInicio \
- (1000) // Begins with MIL Grana
- #define LevelInicio \
- (1) // Starts with Level 1
- #define EmailServidor \
- ("jonathan_souza_1996@hotmail.com") //Your Email Addres
- #define NomeServidor \
- ("[JFS/SAMP] - Recuperar Senha") // Configure :)
- #define TAtualizarLevel \
- (4000) // Time to Upgrade Level, 4 man!
- new
- Invalido[MAXPLAYERSJFS],
- Nome[MAX_PLAYER_NAME],
- String[128]
- ;
- new
- Matou[MAXPLAYERSJFS],
- Morreu[MAXPLAYERSJFS],
- Level[MAXPLAYERSJFS],
- Logou[MAXPLAYERSJFS]
- ;
- public OnFilterScriptInit()
- {
- SetTimer("AtualizarLevel", TAtualizarLevel, true);
- return true;
- }
- public OnFilterScriptExit()
- {
- for(new i=0; i<MAXPLAYERSJFS; ++i)
- {
- CarregarPlayer(i);
- }
- DOF2_Exit();
- return true;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsPlayerConnected(killerid))
- {
- Matou[killerid]++;
- Level[killerid] ++;
- GameTextForPlayer(killerid,"~>~~r~Killed + 1 Level.!!!",4000,3);
- }
- if(IsPlayerConnected(playerid))
- {
- GameTextForPlayer(playerid,"~>~~r~Dead - Level 1!!!",4000,3);
- Level[playerid] --;
- }
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarPlayer(playerid);
- return true;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strfind(cmdtext, "/stats", true) != -1)
- {
- new DialogStatus[250];
- new EmailStats[40];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(EmailStats, sizeof(EmailStats), CONTAS, Nome);
- format(String, sizeof(String),"{FFFFFF}In Status {1E90FF}%s\n\n",Nome);
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}Email: {1E90FF}%s\n", DOF2_GetString(EmailStats,"Email"));
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}Level: {1E90FF}%d\n", Level[playerid]);
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}Money: {1E90FF}%d\n", GetPlayerMoney(playerid));
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}Kills: {1E90FF}%d\n", Matou[playerid]);
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}Death: {1E90FF}%d\n",Morreu[playerid]);
- strcat(DialogStatus, String);
- format(String, sizeof(String),"{FFFFFF}You've Logout {1E90FF}%d{FFFFFF} In times Server", Logou[playerid]);
- strcat(DialogStatus, String);
- ShowPlayerDialog(playerid, 5732, DIALOG_STYLE_MSGBOX, "{00F6F6}My Info( RG )", DialogStatus, "Close", "");
- return true;
- }
- if(strfind(cmdtext, "/mudaremail", true) != -1)
- {
- if(strlen(cmdtext) == 11)
- return SendClientMessage(playerid, -1, "/mudaremail [EMAIL]");
- strdel(cmdtext, 0, 11);
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- new Celula[128];
- format(Celula, sizeof(Celula),"JFS Registration System] - You Changed Your Email from %s to %s !!", DOF2_GetString(String,"Email"), cmdtext);
- SendClientMessage(playerid, -1, Celula);
- SendClientMessage(playerid, -1, "Caution! you should check if it's right! you may lose your Account.");
- DOF2_SetString(String,"Email", cmdtext);
- DOF2_SaveFile();
- return true;
- }
- return false;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "This server has a FilterScript Created By JFS - Jonathan Feitosa:).");
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- if(!DOF2_FileExists(String))
- {
- format(String, sizeof(String), "\n{7FFFD4}Nick: {1E90FF}%s Unregistered\n\n{FFFFFF} Enter A Password For Your Account Register\n", Nome);
- ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "System Register", String, "Register", "Cancel");
- }
- else
- {
- format(String, sizeof(String), "\n{7FFFD4}Nick: {1E90FF}%s Registered\n\n{FFFFFF} Enter your password correctly in space provided\n", Nome);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "System Login", String, "Login", "Cancel");
- }
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == REGISTRO)
- {
- if(response)
- {
- if(!strlen(inputtext))
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), "\n{7FFFD4}Nick: {1E90FF}%s Unregistered\n\n{FFFFFF} Enter A Password For Your Account Register\n", Nome);
- ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "Registration System", String, "Register", "Cancel");
- return true;
- }
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- DOF2_CreateFile(String);
- DOF2_SetString(String,"Senha",inputtext);
- DOF2_SetString(String,"Email","EmailDesconfigurado");
- DOF2_SetInt(String,"Dinheiro", DinheiroInicio);
- DOF2_SetInt(String,"Level", LevelInicio);
- DOF2_SetInt(String,"Matou",0);
- DOF2_SetInt(String,"Admin",0);
- DOF2_SetInt(String,"Morreu",0);
- DOF2_SetInt(String,"Logou",0);
- DOF2_SaveFile();
- ShowPlayerDialog(playerid, 6783, DIALOG_STYLE_INPUT, "JFS Registration - Set up your Email", "\n\n{1E90FF} Enter Your Email below to complete registration.\n\n{1E90FF} PS: If you lose your password, use to recover there.\n\n", "Configure", "");
- return true;
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Why Do not You got kicked Register If I wanted!!");
- Kick(playerid);
- return true;
- }
- }
- if(dialogid == 6783)
- {
- if(response)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- DOF2_SetString(String,"Email", inputtext);
- DOF2_SaveFile();
- format(String, sizeof(String), "Configured Email to: %s", DOF2_GetString(String,"Email"));
- SendClientMessage(playerid, -1, String);
- format(String, sizeof(String), "\n{7FFFD4}Nick: {1E90FF}%s Registered\n\n{FFFFFF} Enter your password correctly to login\n", Nome);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "System Login", String, "Login", "Cancel");
- return true;
- }
- }
- if(dialogid == 6784)
- {
- if(response)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- new Celula[300];
- format(Celula, sizeof(Celula),
- "System Registration/Login with via Email Password Recovery - System Created By Jonathan Feitosa \nVisite: www.facebook.com/GoHumorGTA\n\nPassword: %s\n\n\nContato Skype: jonathanfeitosajfs\nContato MSN: jonathan_feitosa@hotmail.com.br", DOF2_GetString(String,"Senha"));
- SendMail(DOF2_GetString(String,"Email"), EmailServidor, NomeServidor, "JFS Projects - Recover Password", Celula);
- SendClientMessage(playerid, -1, "An email with your password has been sent to your email address successfully.");
- SendClientMessage(playerid, -1, "PS: The Times They may take about 5 minutes at most.");
- Kick(playerid);
- }
- else
- {
- SendClientMessage(playerid, -1, "You would not Send an Email so got kicked :)");
- Kick(playerid);
- }
- return true;
- }
- if(dialogid == LOGIN)
- {
- if(response)
- {
- if(!strlen(inputtext))
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String),
- "\n{7FFFD4}Nick: {1E90FF}%s Registered\n\n{FFFFFF} Enter your password correctly to login\n", Nome);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Sistema de Login", String, "Login", "Cancel");
- SendClientMessage(playerid,0x1E90FFAA,"FIELD BLANK - Enter your password correctly!");
- return true;
- }
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- if(!strcmp(inputtext,DOF2_GetString(String,"Senha"),false))
- {
- Logando(playerid);
- return true;
- }
- else
- {
- Invalido[playerid] += 1;
- if(Invalido[playerid] == 5)
- return ShowPlayerDialog(playerid, 6784, DIALOG_STYLE_MSGBOX, "JFS registration - Password Recovery", "\n\n{33CCFF}Press 'Submit' to send an email to your email address containing your password.\n\n{7491F6}PS: I hope it's a valid email address, if not, please contact Administrator Owner.\n\n", "Submit", "Cancel");
- SendClientMessage(playerid,0x00FF00AA,"Incorrect password, If you miss 5 times there will have to recover by Email!");
- format(String, sizeof(String),
- "\n{7FFFD4}Nick: {1E90FF}%s Registered\n\n{FFFFFF} Enter your password correctly to Login\n", Nome);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "System Login", String, "Login", "Cancel");
- }
- return true;
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "You do not want to login, for this reason can be kicked");
- Kick(playerid);
- return true;
- }
- }
- return true;
- }
- stock SalvarPlayer(playerid)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- DOF2_SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
- DOF2_SetInt(String,"Level", Level[playerid]);
- DOF2_SetInt(String,"Matou", Matou[playerid]);
- DOF2_SetInt(String,"Morreu", Morreu[playerid]);
- DOF2_SetInt(String,"Logou", Logou[playerid]);
- DOF2_SaveFile();
- return true;
- }
- stock CarregarPlayer(playerid)
- {
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), CONTAS, Nome);
- GivePlayerMoney(playerid, DOF2_GetInt(String,"Dinheiro"));
- Level[playerid] = DOF2_GetInt(String, "Level");
- Matou[playerid] = DOF2_GetInt(String, "Matou");
- Morreu[playerid] = DOF2_GetInt(String, "Morreu");
- Logou[playerid] = DOF2_GetInt(String, "Logou");
- DOF2_GetString(String, "Email");
- DOF2_SaveFile();
- return true;
- }
- stock Logando(playerid)
- {
- CarregarPlayer(playerid);
- Logou[playerid]++;
- // Here Bote functions when the player is logging. PS: You may be a tutorial system :)
- return true;
- }
- forward AtualizarLevel();
- public AtualizarLevel()
- {
- for(new i=0; i<MAXPLAYERSJFS; ++i)
- {
- SetPlayerScore(i, Level[i]);
- }
- return true;
- }
Add Comment
Please, Sign In to add comment