Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes
- #include <a_samp>
- #include <YSI\y_ini>
- //TextDraws
- new Text:log0;
- new Text:log1;
- new Text:log2;
- new Text:log3;
- new Text:log4;
- new Text:log5;
- new Text:log6;
- new Text:log7;
- new Text:log8;
- new Text:log9;
- new Text:log10;
- new Text:log11;
- new Text:log12;
- //Defines Macros
- #define SCM SendClientMessage
- #define SCMA SendClientMessageToAll
- //Defines Dialogos
- #define DialogoLogar 1
- #define DialogoRegistrar 2
- #define DialogoSiteForum 3
- #define DialogoRadio 4
- //Define Lugar Dos Arquivos
- #define ArquivoEnviar "/Contas/%s.ini"
- //Enum
- enum JogadorInfo
- {
- Senha,
- Level,
- Dinheiro,
- Matou,
- Morreu,
- }
- //News==========================================================================
- new Jogador[MAX_PLAYERS][JogadorInfo];
- //Stocks========================================================================
- stock nomePlayer(playerid)
- {
- new PlayerName[21];
- GetPlayerName(playerid, PlayerName, 21);
- return PlayerName;
- }
- stock udb_hash(buf[]) {//DracoBlue Créditos
- 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;
- }
- stock Arquivo(playerid)
- {
- new Arquivoo[128], Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(Arquivoo, sizeof(Arquivoo), ArquivoEnviar, Nome);
- return Arquivoo;
- }
- stock SalvarConta(playerid)
- {
- new INI:File = INI_Open(Arquivo(playerid));
- INI_SetTag(File, "[DADOS]");
- INI_WriteInt(File,"Level", GetPlayerScore(playerid));
- INI_WriteInt(File,"Dinheiro", GetPlayerMoney(playerid));
- INI_WriteInt(File,"Matou", Jogador[playerid][Matou]);
- INI_WriteInt(File,"Morreu", Jogador[playerid][Morreu]);
- return 1;
- }
- //Forwards
- forward carregarconta_user(playerid, name[], value[]);
- //Publics
- public carregarconta_user(playerid, name[], value[])
- {
- INI_Int("Senha", Jogador[playerid][Senha]);
- INI_Int("Level", Jogador[playerid][Level]);
- INI_Int("Dinheiro", Jogador[playerid][Dinheiro]);
- INI_Int("Matou", Jogador[playerid][Matou]);
- INI_Int("Morreu", Jogador[playerid][Morreu]);
- return 1;
- }
- //Não retire os Créditos por favor...
- public OnGameModeInit()
- {
- print("========================================================");
- print("| Registro/Login TextDraw Descarregado com Sucesso |");
- print("| Feito Por PedexM |");
- print("| Não retire os Créditos |");
- print("| Carregando 25% |");
- print("| Carregando 50% |");
- print("| Carregando 75% |");
- print("| Carregado Com Sucesso 100% |");
- print("| Utilize com Moderação |");
- print("========================================================\n");
- TextDrawSetSelectable(Text:log1, 1);
- TextDrawSetSelectable(Text:log2, 1);
- TextDrawSetSelectable(Text:log3, 1);
- TextDrawSetSelectable(Text:log4, 1);
- TextDrawSetSelectable(Text:log5, 1);
- log0 = TextDrawCreate(-27.199996, -4.480003, "loadsc11:loadsc11");
- TextDrawLetterSize(log0, 0.087199, 0.343465);
- TextDrawTextSize(log0, 214.399948, 592.105712);
- TextDrawAlignment(log0, 1);
- TextDrawColor(log0, 606480127);
- TextDrawSetShadow(log0, 0);
- TextDrawSetOutline(log0, 0);
- TextDrawFont(log0, 4);
- log1 = TextDrawCreate(31.200004, 62.720184, "Logar");
- TextDrawLetterSize(log1, 0.602000, 2.802133);
- TextDrawAlignment(log1, 1);
- TextDrawColor(log1, 16777215);
- TextDrawSetShadow(log1, 0);
- TextDrawSetOutline(log1, -1);
- TextDrawBackgroundColor(log1, 51);
- TextDrawFont(log1, 2);
- TextDrawSetProportional(log1, 1);
- TextDrawSetSelectable(log1, true);
- log2 = TextDrawCreate(29.600002, 97.813339, "Registrar");
- TextDrawLetterSize(log2, 0.530800, 2.831998);
- TextDrawAlignment(log2, 1);
- TextDrawColor(log2, 16777215);
- TextDrawSetShadow(log2, 0);
- TextDrawSetOutline(log2, 1);
- TextDrawBackgroundColor(log2, 51);
- TextDrawFont(log2, 2);
- TextDrawSetProportional(log2, 1);
- TextDrawSetSelectable(log2, true);
- log3 = TextDrawCreate(30.400003, 133.653289, "Site/Forum");
- TextDrawLetterSize(log3, 0.522000, 2.518399);
- TextDrawAlignment(log3, 1);
- TextDrawColor(log3, 16777215);
- TextDrawSetShadow(log3, 0);
- TextDrawSetOutline(log3, 1);
- TextDrawBackgroundColor(log3, 51);
- TextDrawFont(log3, 2);
- TextDrawSetProportional(log3, 1);
- TextDrawSetSelectable(log3, true);
- log4 = TextDrawCreate(29.600002, 165.013275, "Radio");
- TextDrawLetterSize(log4, 0.489200, 2.675200);
- TextDrawAlignment(log4, 1);
- TextDrawColor(log4, 16777215);
- TextDrawSetShadow(log4, 0);
- TextDrawSetOutline(log4, 1);
- TextDrawBackgroundColor(log4, 51);
- TextDrawFont(log4, 2);
- TextDrawSetProportional(log4, 1);
- TextDrawSetSelectable(log4, true);
- log5 = TextDrawCreate(29.600004, 199.360015, "Sair");
- TextDrawLetterSize(log5, 0.462800, 2.555732);
- TextDrawAlignment(log5, 1);
- TextDrawColor(log5, -2147483393);
- TextDrawSetShadow(log5, 0);
- TextDrawSetOutline(log5, 1);
- TextDrawBackgroundColor(log5, 51);
- TextDrawFont(log5, 2);
- TextDrawSetProportional(log5, 1);
- log6 = TextDrawCreate(115.599998, 67.953330, "usebox");
- TextDrawLetterSize(log6, 0.000000, 1.935185);
- TextDrawTextSize(log6, 24.400001, 0.000000);
- TextDrawAlignment(log6, 1);
- TextDrawColor(log6, 0);
- TextDrawUseBox(log6, true);
- TextDrawBoxColor(log6, 102);
- TextDrawSetShadow(log6, 0);
- TextDrawSetOutline(log6, 0);
- TextDrawFont(log6, 0);
- log7 = TextDrawCreate(158.800003, 103.046669, "usebox");
- TextDrawLetterSize(log7, 0.000000, 1.920370);
- TextDrawTextSize(log7, 22.000003, 0.000000);
- TextDrawAlignment(log7, 1);
- TextDrawColor(log7, 0);
- TextDrawUseBox(log7, true);
- TextDrawBoxColor(log7, 102);
- TextDrawSetShadow(log7, 0);
- TextDrawSetOutline(log7, 0);
- TextDrawFont(log7, 0);
- log8 = TextDrawCreate(169.999938, 138.886672, "usebox");
- TextDrawLetterSize(log8, 0.000000, 1.585554);
- TextDrawTextSize(log8, 22.800001, 0.000000);
- TextDrawAlignment(log8, 1);
- TextDrawColor(log8, 0);
- TextDrawUseBox(log8, true);
- TextDrawBoxColor(log8, 102);
- TextDrawSetShadow(log8, 0);
- TextDrawSetOutline(log8, 0);
- TextDrawFont(log8, 0);
- log9 = TextDrawCreate(98.800003, 171.739990, "usebox");
- TextDrawLetterSize(log9, 0.000000, 1.508518);
- TextDrawTextSize(log9, 24.400001, 0.000000);
- TextDrawAlignment(log9, 1);
- TextDrawColor(log9, 0);
- TextDrawUseBox(log9, true);
- TextDrawBoxColor(log9, 102);
- TextDrawSetShadow(log9, 0);
- TextDrawSetOutline(log9, 0);
- TextDrawFont(log9, 0);
- log10 = TextDrawCreate(79.600006, 203.099990, "usebox");
- TextDrawLetterSize(log10, 0.000000, 1.923335);
- TextDrawTextSize(log10, 24.400001, 0.000000);
- TextDrawAlignment(log10, 1);
- TextDrawColor(log10, 0);
- TextDrawUseBox(log10, true);
- TextDrawBoxColor(log10, 102);
- TextDrawSetShadow(log10, 0);
- TextDrawSetOutline(log10, 0);
- TextDrawFont(log10, 0);
- log11 = TextDrawCreate(12.000023, 23.893346, "Guia Caminhoneiro");
- TextDrawLetterSize(log11, 0.526800, 3.653332);
- TextDrawAlignment(log11, 1);
- TextDrawColor(log11, 201411327);
- TextDrawSetShadow(log11, 0);
- TextDrawSetOutline(log11, 1);
- TextDrawBackgroundColor(log11, 51);
- TextDrawFont(log11, 1);
- TextDrawSetProportional(log11, 1);
- log12 = TextDrawCreate(12.799993, 3.733348, "Seja Bem Vindo!!");
- TextDrawLetterSize(log12, 0.539600, 2.227199);
- TextDrawAlignment(log12, 1);
- TextDrawColor(log12, -2147483393);
- TextDrawSetShadow(log12, 0);
- TextDrawSetOutline(log12, 1);
- TextDrawBackgroundColor(log12, 51);
- TextDrawFont(log12, 1);
- TextDrawSetProportional(log12, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SelectTextDraw(playerid , 0xFFFFFFFF);
- TextDrawShowForPlayer(playerid, log0);
- TextDrawShowForPlayer(playerid, log1);
- TextDrawShowForPlayer(playerid, log2);
- TextDrawShowForPlayer(playerid, log3);
- TextDrawShowForPlayer(playerid, log4);
- TextDrawShowForPlayer(playerid, log5);
- TextDrawShowForPlayer(playerid, log6);
- TextDrawShowForPlayer(playerid, log7);
- TextDrawShowForPlayer(playerid, log8);
- TextDrawShowForPlayer(playerid, log9);
- TextDrawShowForPlayer(playerid, log10);
- TextDrawShowForPlayer(playerid, log11);
- TextDrawShowForPlayer(playerid, log12);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarConta(playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- Jogador[killerid][Matou] ++;
- Jogador[playerid][Morreu] ++;
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DialogoRadio:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:PlayAudioStreamForPlayer(playerid, "http://dc624.4shared.com/img/3501371429/2e84643c/dlink__2Fdownload_2FHrH70Wdz_3Ftsid_3D20141103-015903-f427ece7_26lgfp_3D6000_26sbsr_3D474e4d3212d540ebab4b428aa97be3ed5bb46df75e8ff277/preview.mp3");
- case 1:PlayAudioStreamForPlayer(playerid, "http://dc591.4shared.com/img/4813626005/5f5129aa/dlink__2Fdownload_2F_5FmeLhPAkce_3Ftsid_3D20141103-020134-4fb5122d_26lgfp_3D6000_26sbsr_3D2e35c168350fa6afa41c699b297150d51c3152bb425df5b6/preview.mp3");
- case 2:PlayAudioStreamForPlayer(playerid, "http://dc722.4shared.com/img/4838460613/76a5cafc/dlink__2Fdownload_2FbBDyQZVYce_3Ftsid_3D20141103-020256-5011ea1a_26lgfp_3D6000_26sbsr_3D3f0ba072080069baefae2202ffad233c57d36dc7338fc0e7/preview.mp3");
- }
- }
- }
- case DialogoRegistrar:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DialogoRegistrar, DIALOG_STYLE_INPUT, "Registro","Bem vindo ao Servidor Estúdos\nStatus: Não-Registrada\nColoque sua senha aqui em baixo para se registrar","Registrar","Sair");
- new INI:File = INI_Open(Arquivo(playerid));
- INI_SetTag(File, "[DADOS]");
- INI_WriteInt(File, "Senha", udb_hash(inputtext));
- INI_WriteInt(File, "Level", 0);
- INI_WriteInt(File, "Dinheiro", 0);
- INI_WriteInt(File, "Matou", 0);
- INI_WriteInt(File, "Morreu", 0);
- INI_Close(File);
- SCM(playerid, -1, "{FFFF00}[Server]{BDBDBD}Você se registrou com Sucesso,Aproveite os Benéficios do Nosso Servidor");
- }
- }
- case DialogoLogar:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(udb_hash(inputtext) == Jogador[playerid][Senha])
- {
- INI_ParseFile(Arquivo(playerid),"carregarconta_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, Jogador[playerid][Dinheiro]);
- SetPlayerScore(playerid, Jogador[playerid][Level]);
- SCM(playerid, -1, "{FFFF00}[Server]{BDBDBD}Você logou com Sucesso, Aproveite os Benéficios que o Nosso Servidor Tem!!");
- }
- else
- {
- ShowPlayerDialog(playerid, DialogoLogar, DIALOG_STYLE_INPUT, "Login","Sua senha está incorreta,Corrija sua senha e entre\nStatus: Registrado\nColoque sua senha aqui em baixo para Logar","Entrar","Sair");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == log1)
- {
- if(fexist(Arquivo(playerid)))
- {
- INI_ParseFile(Arquivo(playerid), "carregarconta_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DialogoLogar, DIALOG_STYLE_INPUT, "Logar","{6E6E6E}Bem Vindo de Volta Ao Servidor {C97E6F} ForumSamp\n{6E6E6E}Status: {00FF00}Registrado\n{6E6E6E}Coloque sua senha aqui em baixo para Logar","Entrar","Sair");
- }
- else
- {
- ShowPlayerDialog(playerid, DialogoRegistrar, DIALOG_STYLE_INPUT, "Registro","{6E6E6E}Bem vindo ao Servidor {C97E6F}ForumSamp\n{6E6E6E}Status: {FF0000}Não-Registrada\n{6E6E6E}Coloque sua senha aqui em baixo para se registrar","Registrar","Sair");
- }
- TextDrawHideForPlayer(playerid, log0);
- TextDrawHideForPlayer(playerid,log1);
- TextDrawHideForPlayer(playerid,log2);
- TextDrawHideForPlayer(playerid,log3);
- TextDrawHideForPlayer(playerid,log4);
- TextDrawHideForPlayer(playerid,log5);
- TextDrawHideForPlayer(playerid,log6);
- TextDrawHideForPlayer(playerid,log7);
- TextDrawHideForPlayer(playerid,log8);
- TextDrawHideForPlayer(playerid,log9);
- TextDrawHideForPlayer(playerid,log10);
- TextDrawHideForPlayer(playerid,log11);
- TextDrawHideForPlayer(playerid,log12);
- }
- if(clickedid == log2)
- {
- if(fexist(Arquivo(playerid)))
- {
- INI_ParseFile(Arquivo(playerid), "carregarconta_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DialogoLogar, DIALOG_STYLE_INPUT, "Login","{6E6E6E}Bem Vindo de Volta Ao Servidor {C97E6F} ForumSamp\n{6E6E6E}Status: {00FF00}Registrado\n{6E6E6E}Coloque sua senha aqui em baixo para Logar","Entrar","Sair");
- }
- else
- {
- ShowPlayerDialog(playerid, DialogoRegistrar, DIALOG_STYLE_INPUT, "Registro","{6E6E6E}Bem vindo ao Servidor {C97E6F}ForumSamp\n{6E6E6E}Status: {FF0000}Não-Registrada\n{6E6E6E}Coloque sua senha aqui em baixo para se registrar","Registrar","Sair");
- }
- TextDrawHideForPlayer(playerid, log0);
- TextDrawHideForPlayer(playerid,log1);
- TextDrawHideForPlayer(playerid,log2);
- TextDrawHideForPlayer(playerid,log3);
- TextDrawHideForPlayer(playerid,log4);
- TextDrawHideForPlayer(playerid,log5);
- TextDrawHideForPlayer(playerid,log6);
- TextDrawHideForPlayer(playerid,log7);
- TextDrawHideForPlayer(playerid,log8);
- TextDrawHideForPlayer(playerid,log9);
- TextDrawHideForPlayer(playerid,log10);
- TextDrawHideForPlayer(playerid,log11);
- TextDrawHideForPlayer(playerid,log12);
- }
- if(clickedid == log5)
- {
- Kick(playerid);
- }
- if(clickedid == log4)
- {
- ShowPlayerDialog(playerid, DialogoRadio, DIALOG_STYLE_LIST, "Rádios","Chris Brown - Don't Wake Me Up\nNirvana - Smeel Like Time Spirit\nThe Wanted - Glad You Came","Selecionar","Sair");
- }
- if(clickedid == log3)
- {
- ShowPlayerDialog(playerid, DialogoSiteForum, DIALOG_STYLE_MSGBOX, "Fórum/Site","{FF0000}www.forum.sa-mp.com\n Acesse Agora,O Melhor Portal De Ajudas e Dúvidas para SAMP!","Ok","");
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment