WhooProg

Whoo System Regis

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