Guest User

Sistema de Registro/Login em TextDraws v1

a guest
Dec 13th, 2014
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 19.10 KB | None | 0 0
  1. /*
  2. • Sistema de Registro e Login com TextDraw
  3. • Criador: Whoo
  4. • Creditos Whoo
  5.  
  6. ////         //// ///    ///  ///////////   ///////////
  7. ///    /     ///  ///    ///  ///     ///   ///     ///
  8. ///   //     ///  //////////  ///     ///   ///     ///
  9. /// //  //  ///   ///    ///  ///     ///   ///     ///
  10. /////   ///////   ///    ///  ///////////   ///////////
  11.  
  12. • 10/12/2014 •
  13. */
  14.  
  15.  
  16. #define FILTERSCRIPT
  17.  
  18. //                          INCLUDES                            //
  19. #include                    <a_samp>
  20. #include                    <dof2>
  21.  
  22. #if defined FILTERSCRIPT
  23.  
  24. //                          DIALOGS                             //
  25. #define                     DIALOG_REGISTRO             ( 1 )
  26. #define                     DIALOG_LOGIN                ( 2 )
  27. #define                     DIALOG_AVISO                ( 3 )
  28.  
  29. //                          CORES                               //
  30. #define                     COR_AZUL_ADMIN              0x4876FFFF
  31. #define                     COR_AVISO                   0x8B8B83FF
  32. #define                     COR_SUCESSO                 0x54FF9FFF
  33.  
  34. new                         Text:Registro[19];
  35.  
  36. new
  37. IP[26],
  38. Arquivo[40],
  39. String[256],
  40. Administrador[MAX_PLAYERS],
  41. Level[MAX_PLAYERS],
  42. Skin[MAX_PLAYERS],
  43. Matou[MAX_PLAYERS],
  44. Morreu[MAX_PLAYERS],
  45. PlayerERRO[MAX_PLAYERS],
  46. Nome[MAX_PLAYER_NAME]
  47. //ANome[MAX_PLAYER_NAME]
  48. ;
  49.  
  50. public OnFilterScriptInit()
  51. {
  52.     print("\n------------------------------------------------------------------");
  53.     print(" SISTEMA DE REGISTRO/LOGIN COM TEXTDRAW CARREGADO");
  54.     print(" Creditos: Whoo");
  55.     print("------------------------------------------------------------------\n");
  56.  
  57.     Registro[0] = TextDrawCreate(640.000000, 0.000000, "         ");
  58.     TextDrawBackgroundColor(Registro[0], 255);
  59.     TextDrawFont(Registro[0], 1);
  60.     TextDrawLetterSize(Registro[0], 0.500000, 8.000000);
  61.     TextDrawColor(Registro[0], -1);
  62.     TextDrawSetOutline(Registro[0], 0);
  63.     TextDrawSetProportional(Registro[0], 1);
  64.     TextDrawSetShadow(Registro[0], 1);
  65.     TextDrawUseBox(Registro[0], 1);
  66.     TextDrawBoxColor(Registro[0], 35);
  67.     TextDrawTextSize(Registro[0], -30.000000, 19.000000);
  68.  
  69.     Registro[1] = TextDrawCreate(388.000000, 161.000000, "          ");
  70.     TextDrawBackgroundColor(Registro[1], 255);
  71.     TextDrawFont(Registro[1], 1);
  72.     TextDrawLetterSize(Registro[1], 0.500000, 0.199999);
  73.     TextDrawColor(Registro[1], -1);
  74.     TextDrawSetOutline(Registro[1], 0);
  75.     TextDrawSetProportional(Registro[1], 1);
  76.     TextDrawSetShadow(Registro[1], 1);
  77.     TextDrawUseBox(Registro[1], 1);
  78.     TextDrawBoxColor(Registro[1], 60);
  79.     TextDrawTextSize(Registro[1], 257.000000, -20.000000);
  80.  
  81.     Registro[2] = TextDrawCreate(388.000000, 190.000000, "          ");
  82.     TextDrawBackgroundColor(Registro[2], 255);
  83.     TextDrawFont(Registro[2], 1);
  84.     TextDrawLetterSize(Registro[2], 0.500000, 0.199999);
  85.     TextDrawColor(Registro[2], -1);
  86.     TextDrawSetOutline(Registro[2], 0);
  87.     TextDrawSetProportional(Registro[2], 1);
  88.     TextDrawSetShadow(Registro[2], 1);
  89.     TextDrawUseBox(Registro[2], 1);
  90.     TextDrawBoxColor(Registro[2], 70);
  91.     TextDrawTextSize(Registro[2], 257.000000, -20.000000);
  92.  
  93.     Registro[3] = TextDrawCreate(388.000000, 218.000000, "          ");
  94.     TextDrawBackgroundColor(Registro[3], 255);
  95.     TextDrawFont(Registro[3], 1);
  96.     TextDrawLetterSize(Registro[3], 0.500000, 0.199999);
  97.     TextDrawColor(Registro[3], -1);
  98.     TextDrawSetOutline(Registro[3], 0);
  99.     TextDrawSetProportional(Registro[3], 1);
  100.     TextDrawSetShadow(Registro[3], 1);
  101.     TextDrawUseBox(Registro[3], 1);
  102.     TextDrawBoxColor(Registro[3], 70);
  103.     TextDrawTextSize(Registro[3], 257.000000, -20.000000);
  104.  
  105.     Registro[4] = TextDrawCreate(388.000000, 247.000000, "          ");
  106.     TextDrawBackgroundColor(Registro[4], 255);
  107.     TextDrawFont(Registro[4], 1);
  108.     TextDrawLetterSize(Registro[4], 0.500000, 0.199999);
  109.     TextDrawColor(Registro[4], -1);
  110.     TextDrawSetOutline(Registro[4], 0);
  111.     TextDrawSetProportional(Registro[4], 1);
  112.     TextDrawSetShadow(Registro[4], 1);
  113.     TextDrawUseBox(Registro[4], 1);
  114.     TextDrawBoxColor(Registro[4], 70);
  115.     TextDrawTextSize(Registro[4], 257.000000, -20.000000);
  116.  
  117.     Registro[5] = TextDrawCreate(282.000000, 162.000000, "Registrar");
  118.     TextDrawBackgroundColor(Registro[5], 255);
  119.     TextDrawFont(Registro[5], 2);
  120.     TextDrawLetterSize(Registro[5], 0.349999, 1.500000);
  121.     TextDrawColor(Registro[5], -1);
  122.     TextDrawSetOutline(Registro[5], 1);
  123.     TextDrawSetProportional(Registro[5], 1);
  124.  
  125.     Registro[6] = TextDrawCreate(298.000000, 191.000000, "Logar");
  126.     TextDrawBackgroundColor(Registro[6], 255);
  127.     TextDrawFont(Registro[6], 2);
  128.     TextDrawLetterSize(Registro[6], 0.349999, 1.500000);
  129.     TextDrawColor(Registro[6], -1);
  130.     TextDrawSetOutline(Registro[6], 1);
  131.     TextDrawSetProportional(Registro[6], 1);
  132.  
  133.     Registro[7] = TextDrawCreate(306.000000, 218.000000, "Info");
  134.     TextDrawBackgroundColor(Registro[7], 255);
  135.     TextDrawFont(Registro[7], 2);
  136.     TextDrawLetterSize(Registro[7], 0.349999, 1.500000);
  137.     TextDrawColor(Registro[7], -1);
  138.     TextDrawSetOutline(Registro[7], 1);
  139.     TextDrawSetProportional(Registro[7], 1);
  140.  
  141.     Registro[8] = TextDrawCreate(305.000000, 247.000000, "Sair");
  142.     TextDrawBackgroundColor(Registro[8], 255);
  143.     TextDrawFont(Registro[8], 2);
  144.     TextDrawLetterSize(Registro[8], 0.349999, 1.500000);
  145.     TextDrawColor(Registro[8], -1);
  146.     TextDrawSetOutline(Registro[8], 1);
  147.     TextDrawSetProportional(Registro[8], 1);
  148.  
  149.     Registro[9] = TextDrawCreate(650.000000, 68.000000, "         ");
  150.     TextDrawBackgroundColor(Registro[9], 255);
  151.     TextDrawFont(Registro[9], 1);
  152.     TextDrawLetterSize(Registro[9], 0.800000, 0.000000);
  153.     TextDrawColor(Registro[9], -1);
  154.     TextDrawSetOutline(Registro[9], 0);
  155.     TextDrawSetProportional(Registro[9], 1);
  156.     TextDrawSetShadow(Registro[9], 1);
  157.     TextDrawUseBox(Registro[9], 1);
  158.     TextDrawBoxColor(Registro[9], 1131343615);
  159.     TextDrawTextSize(Registro[9], -11.000000, 0.000000);
  160.  
  161.     Registro[10] = TextDrawCreate(650.000000, 378.000000, "         ");
  162.     TextDrawBackgroundColor(Registro[10], 255);
  163.     TextDrawFont(Registro[10], 1);
  164.     TextDrawLetterSize(Registro[10], 0.800000, -0.099999);
  165.     TextDrawColor(Registro[10], -1);
  166.     TextDrawSetOutline(Registro[10], 0);
  167.     TextDrawSetProportional(Registro[10], 1);
  168.     TextDrawSetShadow(Registro[10], 1);
  169.     TextDrawUseBox(Registro[10], 1);
  170.     TextDrawBoxColor(Registro[10], 1131343615);
  171.     TextDrawTextSize(Registro[10], -11.000000, 0.000000);
  172.  
  173.     Registro[11] = TextDrawCreate(261.000000, 161.000000, "   ");
  174.     TextDrawBackgroundColor(Registro[11], 255);
  175.     TextDrawFont(Registro[11], 1);
  176.     TextDrawLetterSize(Registro[11], 0.500000, 0.899999);
  177.     TextDrawColor(Registro[11], -1);
  178.     TextDrawSetOutline(Registro[11], 0);
  179.     TextDrawSetProportional(Registro[11], 1);
  180.     TextDrawSetShadow(Registro[11], 1);
  181.     TextDrawUseBox(Registro[11], 1);
  182.     TextDrawBoxColor(Registro[11], 255);
  183.     TextDrawTextSize(Registro[11], 262.000000, 0.000000);
  184.  
  185.     Registro[12] = TextDrawCreate(261.000000, 190.000000, "   ");
  186.     TextDrawBackgroundColor(Registro[12], 255);
  187.     TextDrawFont(Registro[12], 1);
  188.     TextDrawLetterSize(Registro[12], 0.500000, 0.899999);
  189.     TextDrawColor(Registro[12], -1);
  190.     TextDrawSetOutline(Registro[12], 0);
  191.     TextDrawSetProportional(Registro[12], 1);
  192.     TextDrawSetShadow(Registro[12], 1);
  193.     TextDrawUseBox(Registro[12], 1);
  194.     TextDrawBoxColor(Registro[12], 1131343615);
  195.     TextDrawTextSize(Registro[12], 262.000000, 0.000000);
  196.  
  197.     Registro[13] = TextDrawCreate(261.000000, 218.000000, "   ");
  198.     TextDrawBackgroundColor(Registro[13], 255);
  199.     TextDrawFont(Registro[13], 1);
  200.     TextDrawLetterSize(Registro[13], 0.500000, 0.899999);
  201.     TextDrawColor(Registro[13], -1);
  202.     TextDrawSetOutline(Registro[13], 0);
  203.     TextDrawSetProportional(Registro[13], 1);
  204.     TextDrawSetShadow(Registro[13], 1);
  205.     TextDrawUseBox(Registro[13], 1);
  206.     TextDrawBoxColor(Registro[13], 255);
  207.     TextDrawTextSize(Registro[13], 262.000000, 0.000000);
  208.  
  209.     Registro[14] = TextDrawCreate(261.000000, 247.000000, "   ");
  210.     TextDrawBackgroundColor(Registro[14], 255);
  211.     TextDrawFont(Registro[14], 1);
  212.     TextDrawLetterSize(Registro[14], 0.500000, 0.899999);
  213.     TextDrawColor(Registro[14], -1);
  214.     TextDrawSetOutline(Registro[14], 0);
  215.     TextDrawSetProportional(Registro[14], 1);
  216.     TextDrawSetShadow(Registro[14], 1);
  217.     TextDrawUseBox(Registro[14], 1);
  218.     TextDrawBoxColor(Registro[14], 1131343615);
  219.     TextDrawTextSize(Registro[14], 262.000000, 0.000000);
  220.  
  221.     Registro[15] = TextDrawCreate(388.000000, 247.000000, "   ");
  222.     TextDrawBackgroundColor(Registro[15], 255);
  223.     TextDrawFont(Registro[15], 1);
  224.     TextDrawLetterSize(Registro[15], 0.500000, 0.899999);
  225.     TextDrawColor(Registro[15], -1);
  226.     TextDrawSetOutline(Registro[15], 0);
  227.     TextDrawSetProportional(Registro[15], 1);
  228.     TextDrawSetShadow(Registro[15], 1);
  229.     TextDrawUseBox(Registro[15], 1);
  230.     TextDrawBoxColor(Registro[15], 1131343615);
  231.     TextDrawTextSize(Registro[15], 379.000000, 0.000000);
  232.  
  233.     Registro[16] = TextDrawCreate(388.000000, 190.000000, "   ");
  234.     TextDrawBackgroundColor(Registro[16], 255);
  235.     TextDrawFont(Registro[16], 1);
  236.     TextDrawLetterSize(Registro[16], 0.500000, 0.899999);
  237.     TextDrawColor(Registro[16], -1);
  238.     TextDrawSetOutline(Registro[16], 0);
  239.     TextDrawSetProportional(Registro[16], 1);
  240.     TextDrawSetShadow(Registro[16], 1);
  241.     TextDrawUseBox(Registro[16], 1);
  242.     TextDrawBoxColor(Registro[16], 1131343615);
  243.     TextDrawTextSize(Registro[16], 379.000000, 0.000000);
  244.  
  245.     Registro[17] = TextDrawCreate(388.000000, 218.000000, "   ");
  246.     TextDrawBackgroundColor(Registro[17], 255);
  247.     TextDrawFont(Registro[17], 1);
  248.     TextDrawLetterSize(Registro[17], 0.500000, 0.899999);
  249.     TextDrawColor(Registro[17], -1);
  250.     TextDrawSetOutline(Registro[17], 0);
  251.     TextDrawSetProportional(Registro[17], 1);
  252.     TextDrawSetShadow(Registro[17], 1);
  253.     TextDrawUseBox(Registro[17], 1);
  254.     TextDrawBoxColor(Registro[17], 255);
  255.     TextDrawTextSize(Registro[17], 379.000000, 0.000000);
  256.  
  257.     Registro[18] = TextDrawCreate(388.000000, 161.000000, "   ");
  258.     TextDrawBackgroundColor(Registro[18], 255);
  259.     TextDrawFont(Registro[18], 1);
  260.     TextDrawLetterSize(Registro[18], 0.500000, 0.899999);
  261.     TextDrawColor(Registro[18], -1);
  262.     TextDrawSetOutline(Registro[18], 0);
  263.     TextDrawSetProportional(Registro[18], 1);
  264.     TextDrawSetShadow(Registro[18], 1);
  265.     TextDrawUseBox(Registro[18], 1);
  266.     TextDrawBoxColor(Registro[18], 255);
  267.     TextDrawTextSize(Registro[18], 379.000000, 0.000000);
  268.  
  269.     TextDrawSetSelectable(Registro[5], 1);
  270.     TextDrawSetSelectable(Registro[6], 1);
  271.     TextDrawSetSelectable(Registro[7], 1);
  272.     TextDrawSetSelectable(Registro[8], 1);
  273.     return 1;
  274. }
  275.  
  276. public OnFilterScriptExit()
  277. {
  278.     return 1;
  279. }
  280.  
  281. public OnPlayerRequestClass(playerid, classid)
  282. {
  283.     InterpolateCameraPos(playerid, -2328.572021, 1456.048095, 141.509216, -2928.397460, 1388.436035, 164.589508, 15000);
  284.     InterpolateCameraLookAt(playerid, -2332.968994, 1457.633422, 139.733627, -2924.312500, 1390.837646, 162.994110, 15000);
  285.     return 1;
  286. }
  287.  
  288. public OnPlayerConnect(playerid)
  289. {
  290.     SelectTextDraw(playerid, 0x00EEEEFF);
  291.     TextDrawShowForPlayer(playerid, Registro[0]);
  292.     TextDrawShowForPlayer(playerid, Registro[1]);
  293.     TextDrawShowForPlayer(playerid, Registro[2]);
  294.     TextDrawShowForPlayer(playerid, Registro[3]);
  295.     TextDrawShowForPlayer(playerid, Registro[4]);
  296.     TextDrawShowForPlayer(playerid, Registro[5]);
  297.     TextDrawShowForPlayer(playerid, Registro[6]);
  298.     TextDrawShowForPlayer(playerid, Registro[7]);
  299.     TextDrawShowForPlayer(playerid, Registro[8]);
  300.     TextDrawShowForPlayer(playerid, Registro[9]);
  301.     TextDrawShowForPlayer(playerid, Registro[10]);
  302.     TextDrawShowForPlayer(playerid, Registro[11]);
  303.     TextDrawShowForPlayer(playerid, Registro[12]);
  304.     TextDrawShowForPlayer(playerid, Registro[13]);
  305.     TextDrawShowForPlayer(playerid, Registro[14]);
  306.     TextDrawShowForPlayer(playerid, Registro[15]);
  307.     TextDrawShowForPlayer(playerid, Registro[16]);
  308.     TextDrawShowForPlayer(playerid, Registro[17]);
  309.     TextDrawShowForPlayer(playerid, Registro[18]);
  310.     return 1;
  311. }
  312.  
  313. public OnPlayerDisconnect(playerid, reason)
  314. {
  315.     SavePlayer(playerid);
  316.     return 1;
  317. }
  318.  
  319. public OnPlayerSpawn(playerid)
  320. {
  321.     SetPlayerSkin(playerid, Skin[playerid]);
  322.     TextDrawHideForPlayer(playerid, Registro[0]);
  323.     TextDrawHideForPlayer(playerid, Registro[1]);
  324.     TextDrawHideForPlayer(playerid, Registro[2]);
  325.     TextDrawHideForPlayer(playerid, Registro[3]);
  326.     TextDrawHideForPlayer(playerid, Registro[4]);
  327.     TextDrawHideForPlayer(playerid, Registro[5]);
  328.     TextDrawHideForPlayer(playerid, Registro[6]);
  329.     TextDrawHideForPlayer(playerid, Registro[7]);
  330.     TextDrawHideForPlayer(playerid, Registro[8]);
  331.     TextDrawHideForPlayer(playerid, Registro[9]);
  332.     TextDrawHideForPlayer(playerid, Registro[10]);
  333.     TextDrawHideForPlayer(playerid, Registro[11]);
  334.     TextDrawHideForPlayer(playerid, Registro[12]);
  335.     TextDrawHideForPlayer(playerid, Registro[13]);
  336.     TextDrawHideForPlayer(playerid, Registro[14]);
  337.     TextDrawHideForPlayer(playerid, Registro[15]);
  338.     TextDrawHideForPlayer(playerid, Registro[16]);
  339.     TextDrawHideForPlayer(playerid, Registro[17]);
  340.     TextDrawHideForPlayer(playerid, Registro[18]);
  341.     return 1;
  342. }
  343.  
  344. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  345. {
  346.     if(dialogid == DIALOG_REGISTRO)
  347.     {
  348.  
  349.  
  350.         if(response)
  351.         {
  352.  
  353.  
  354.             if(strlen(inputtext) < 5 || strlen(inputtext) > 16 && !strlen(inputtext))
  355.             {
  356.  
  357.  
  358.                 SendClientMessage(playerid, COR_AVISO,"| AVISO | Atenção a Senha tem que ter no Minimo 5 Caracteres ou no Máximo 16 Caracteres.");
  359.                 format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ainda nao tem uma Conta Registrada\n\nDigite Digite uma Senha para se Registrar\n\nStatus: {FF4040}N/A Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  360.                 ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "-- REGISTRANDO --", String, "Registrar", "Cancelar");
  361.                 return 1;
  362.             }
  363.             GetPlayerName(playerid, Nome, sizeof(Nome));
  364.             GetPlayerIp(playerid, IP, sizeof(IP));
  365.             format(Arquivo, sizeof(Arquivo), "Registros/%s.ini", Nome);
  366.  
  367.             DOF2_CreateFile(Arquivo);
  368.             DOF2_SetString(Arquivo, "Senha", inputtext);
  369.             DOF2_SetInt(Arquivo, "Administrador", 0);
  370.             DOF2_SetInt(Arquivo, "Level", 0);
  371.             DOF2_SetInt(Arquivo, "Skin", 98);
  372.             DOF2_SetInt(Arquivo, "Matou", 0);
  373.             DOF2_SetInt(Arquivo, "Morreu", 0);
  374.             DOF2_SetInt(Arquivo, "Dinheiro", 550);
  375.             DOF2_SaveFile();
  376.  
  377.             SendClientMessage(playerid, COR_SUCESSO,"| INFO | Você se Registrou com Sucesso, Agora digite sua Senha para Logar");
  378.             format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ja tem uma Conta Registrada\n\nDigite sua senha para Logar\n\nStatus:{FF4040}Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  379.             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "-- LOGANDO --", String, "Logar", "Cancelar");
  380.             return 1;
  381.         }
  382.         else
  383.         {
  384.  
  385.  
  386.             format(String, sizeof(String), "| INFO | O Jogador(a) %s Foi Kickado do Servidor Motivo: N/A Registrou.", Nome);
  387.             SendClientMessageToAll(COR_AZUL_ADMIN, String);
  388.             Kick(playerid);
  389.         }
  390.     }
  391.     if(dialogid == DIALOG_LOGIN)
  392.     {
  393.         GetPlayerName(playerid, Nome, sizeof(Nome));
  394.         GetPlayerIp(playerid, IP, sizeof(IP));
  395.  
  396.         if(response)
  397.         {
  398.  
  399.  
  400.             if(!strlen(inputtext))
  401.             {
  402.  
  403.  
  404.                 SendClientMessage(playerid, COR_AVISO,"| AVISO | Atenção digite sua Senha para Logar.");
  405.                 format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ja tem uma Conta Registrada\n\nDigite sua senha para Logar\n\nStatus:{FF4040}Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  406.                 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "-- LOGANDO --", String, "Logar", "Cancelar");
  407.                 return 1;
  408.             }
  409.             if(!strcmp(inputtext,DOF2_GetString(Arquivo, "Senha"),false))
  410.             {
  411.  
  412.  
  413.                 Logar(playerid);
  414.                 return 1;
  415.             }
  416.             else
  417.             {
  418.  
  419.  
  420.                 SendClientMessage(playerid, COR_AVISO,"| AVISO | Senha incorreta digite-a novamente, se errar 3 vezes você sera Kickado.");
  421.                 format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ja tem uma Conta Registrada\n\nDigite sua senha para Logar\n\nStatus:{FF4040}Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  422.                 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "-- LOGANDO --", String, "Logar", "Cancelar");
  423.  
  424.                 PlayerERRO[playerid]++;
  425.                 if(PlayerERRO[playerid]==3)
  426.                 {
  427.  
  428.  
  429.                     format(String, sizeof(String), "| INFO | O Jogador(a) %s Foi Kickado do Servidor Motivo: Limite de Erro.", Nome);
  430.                     SendClientMessageToAll(COR_AZUL_ADMIN, String);
  431.                     Kick(playerid);
  432.                     return 1;
  433.                 }
  434.             }
  435.         }
  436.         else
  437.         {
  438.  
  439.  
  440.             format(String, sizeof(String), "| INFO | O Jogador(a) %s Foi Kickado do Servidor Motivo: N/A Registrou.", Nome);
  441.             SendClientMessageToAll(COR_AZUL_ADMIN, String);
  442.             Kick(playerid);
  443.         }
  444.     }
  445.     return 1;
  446. }
  447.  
  448. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  449. {
  450.     return 1;
  451. }
  452.  
  453. stock SavePlayer(playerid)
  454. {
  455.     GetPlayerName(playerid, Nome, sizeof(Nome));
  456.     format(Arquivo, sizeof(Arquivo), "Registros/%s.ini", Nome);
  457.  
  458.     if(DOF2_FileExists(Arquivo))
  459.     {
  460.  
  461.         DOF2_SetInt(Arquivo,"Administrador", Administrador[playerid]);
  462.         DOF2_SetInt(Arquivo,"Dinheiro", GetPlayerMoney(playerid));
  463.         DOF2_SetInt(Arquivo,"Level", Level[playerid]);
  464.         Skin[playerid] = GetPlayerSkin(playerid);
  465.         DOF2_SetInt(Arquivo,"Skin", Skin[playerid]);
  466.         DOF2_SetInt(Arquivo,"Matou", Matou[playerid]);
  467.         DOF2_SetInt(Arquivo,"Morreu", Morreu[playerid]);
  468.         DOF2_SaveFile();
  469.     }
  470.     return 1;
  471. }
  472.  
  473. stock Logar(playerid)
  474. {
  475.     GetPlayerName(playerid, Nome, sizeof(Nome));
  476.     format(Arquivo, sizeof(Arquivo), "Registros/%s.ini", Nome);
  477.  
  478.     Administrador[playerid] = DOF2_GetInt(Arquivo, "Administrador");
  479.     Level[playerid] = DOF2_GetInt(Arquivo, "Level");
  480.     Skin[playerid] = DOF2_GetInt(Arquivo, "Skin");
  481.     Matou[playerid] = DOF2_GetInt(Arquivo, "Matou");
  482.     Morreu[playerid] = DOF2_GetInt(Arquivo, "Morreu");
  483.     GivePlayerMoney(playerid, DOF2_GetInt(Arquivo,"Dinheiro"));
  484.     CancelSelectTextDraw(playerid);
  485.     SpawnPlayer(playerid);
  486.     DOF2_SaveFile();
  487.  
  488.     return 1;
  489. }
  490.  
  491. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  492. {
  493.     GetPlayerName(playerid, Nome, sizeof(Nome));
  494.     format(Arquivo, sizeof(Arquivo), "Registros/%s.ini", Nome);
  495.         GetPlayerIp(playerid, IP, sizeof(IP));
  496.  
  497.     if(clickedid == Registro[5] )
  498.     {
  499.  
  500.         if(DOF2_FileExists(Arquivo))
  501.         {
  502.  
  503.             SendClientMessage(playerid, COR_AVISO, "| AVISO | Atenção Você ja tem uma Conta, Clique em Logar para Logar.");
  504.         }
  505.         else
  506.         {
  507.  
  508.             format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ainda nao tem uma Conta Registrada\n\nDigite Digite uma Senha para se Registrar\n\nStatus: {FF4040}N/A Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  509.             ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "-- REGISTRANDO --", String, "Registrar", "Cancelar");
  510.         }
  511.     }
  512.     if(clickedid == Registro[6])
  513.     {
  514.  
  515.         if(DOF2_FileExists(Arquivo))
  516.         {
  517.  
  518.             format(String, sizeof(String), "{F8F8FF}Bem Vindo ao Servidor {FF4040}%s{F8F8FF}\n\nVocê ja tem uma Conta Registrada\n\nDigite sua senha para Logar\n\nStatus:{FF4040}Registrado.\n\n{F8F8FF}IP:{FF4040}%s", Nome, IP);
  519.             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "-- LOGANDO --", String, "Logar", "Cancelar");
  520.         }
  521.         else
  522.         {
  523.  
  524.             SendClientMessage(playerid, COR_AVISO, "| AVISO | Atenção Você não tem uma Conta, Clique em Registrar para Registrar.");
  525.         }
  526.     }
  527.     if(clickedid == Registro[7])
  528.     {
  529.  
  530.         SendClientMessage(playerid, COR_AVISO, "| AVISO | INFO.");
  531.     }
  532.     if(clickedid == Registro[8])
  533.     {
  534.  
  535.         format(String, sizeof(String), "| INFO | O Jogador(a) %s Saiu do Servidor", Nome);
  536.         SendClientMessageToAll(COR_AZUL_ADMIN, String);
  537.     }
  538.     return 1;
  539. }
  540.  
  541. #endif
Add Comment
Please, Sign In to add comment