Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #define DIALOG_REGISTRO 1
- #define DIALOG_LOGIN 2
- #define CONTAS "Contas/%s.ini"
- #define TXT_RLOGIN "{FFFFFF}Nick: %s Registrado\n\n Digite Sua Senha Para Logar"
- #define TXT_LOGIN "{FFFFFF}Olá Você Esta Registrado\nStatus Da Conta\nNick: %s Registrado\n\n Digite Sua Senha Para Logar"
- #define TXT_NREGISTER "{FFFFFF}Olá, Você Não Esta Registrado\nStatus Da Conta\nNick: %s \nDigite Uma Senha Para Continuar"
- #define TXT_RL "Pronto você esta registrado \nAgora digite Sua Senha Para Logar-Se"
- new TotalMatou[MAX_PLAYERS];
- new TotalMorreu[MAX_PLAYERS];
- new TotalLogou[MAX_PLAYERS];
- forward SalvarLevel(playerid);
- forward CarregarLevel(playerid);
- public OnFilterScriptInit()
- {
- print("\n\n__________________________________________________________________");
- print(" Sistema de registro MTO loaded!");
- print(" By : mau_tito");
- print(" ---------------------------");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n\n__________________________________________________________________");
- print(" Sistema de registro MTO loaded!");
- print(" By : mau_tito");
- print(" ---------------------------");
- return 1;
- }
- SalvarPlayer(playerid)
- {
- new Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- new String[50];
- format(String, sizeof(String), CONTAS, Nome);
- dini_IntSet(String,"Dinheiro", GetPlayerMoney(playerid));
- dini_IntSet(String,"Total Matou", TotalMatou[playerid]);
- dini_IntSet(String,"Total Morreu", TotalMorreu[playerid]);
- dini_IntSet(String,"Total Logou", TotalLogou[playerid]);
- return 1;
- }
- CarregarPlayer(playerid)
- {
- new Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- new String[50];
- format(String, sizeof(String), CONTAS, Nome);
- GivePlayerMoney(playerid, dini_Int(String,"Dinheiro"));
- TotalMatou[playerid] = dini_Int(String, "Total Matou");
- TotalMorreu[playerid] = dini_Int(String, "Total Morreu");
- TotalLogou[playerid] = dini_Int(String, "Total Logou");
- return 1;
- }
- public OnGameModeExit()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- SalvarPlayer(i);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- new String[100];
- format(String, sizeof(String), CONTAS, Nome);
- if(!dini_Exists(String))
- {
- format(String, sizeof(String), TXT_NREGISTER, Nome);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, 3, "Registro", String, "Registrar", "Cancelar");
- }
- else
- {
- format(String, sizeof(String),TXT_LOGIN, Nome);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, 3, "Registro Com Sucesso", String, "Logar", "Cancelar");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarPlayer(playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsPlayerConnected(killerid))
- {
- TotalMatou[killerid]++;
- }
- TotalMorreu[playerid]++;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement