Guest User

išsiversti turėsit darbo :|

a guest
Feb 9th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.11 KB | None | 0 0
  1. /* Gamemode Creado con el tutorial de Zume-Zero (Dr.Marlboro)
  2.  
  3. * Créditos:
  4.     * Zume-Zero (Dr.Marlboro)
  5.  
  6. * Este es un Gamemode creado desde 0 como base para que los demįs puedan usarlo
  7.   Fįcilmente.
  8.  
  9. * Sistema de guardado en Y_INI, almacena:
  10.     * Contraseńa.
  11.     * Nivel administrativo.
  12.     * Nivel.
  13.     * Dinero.
  14.     * Sexo.
  15.     * Edad.
  16.     * Comprobar si estį registrado.
  17.     * Posición (X,Y,Z,R).
  18.     * Vida.
  19.     * Chaleco.
  20.     * Interior.
  21.     * VirtualWorld.
  22.     * Ropa.
  23.  
  24. */
  25.  
  26. #include <a_samp>
  27. #include <YSI\y_ini>
  28. #include <Streamer>
  29.  
  30. // Macros.
  31. #define ARCHIVO_L "Usuarios/%s.ini"
  32. #define NOMBRE_SERVER "Servidor creado con el tutorial de Zume-Zero"
  33. #define GAMEMODE_TEXTO "Version 1.0"
  34. #define WEB_SERVER "www.Google.com" // (?
  35. #define PASS_RCON "sdKLw3FKSDFKLcsdklńf" // Rcon, la cambian a como la quieran.
  36. #define MAPA_SERVER "Los Santos"
  37. #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  38.  
  39. // Créditos en main()
  40. #define CREADO_CON_TUTO_DE "Zume-Zero (Dr.Marlboro)"
  41. #define YO_PROGRAMADOR     "AQUI PON TU NOMBRE"
  42.  
  43. // Diįlogos.
  44. #define DIALOG_REGISTRO 8541
  45. #define DIALOG_LOGEO 8542
  46. #define DIALOG_SEXO 8543
  47. #define DIALOG_EDAD 8544
  48.  
  49. // Pragma
  50. #pragma tabsize 0
  51.  
  52. // Enumeración de variables del usuario.
  53. enum Info
  54. {
  55.     pKey[32],
  56.     pAdmin,
  57.     pNivel,
  58.     pDinero,
  59.     pSexo,
  60.     pEdad,
  61.     pRegistrado,
  62.     Float:pPos_x,
  63.     Float:pPos_y,
  64.     Float:pPos_z,
  65.     Float:pPos_r,
  66.     Float:pVida,
  67.     Float:pChaleco,
  68.     pInterior,
  69.     pVirtualWorld,
  70.     pRopaPuesta,
  71. };
  72. new DatosPJ[MAX_PLAYERS][Info];
  73.  
  74. // Textdraws
  75. new Text:CajaSola,
  76.     Text:TeclaInfo,
  77.     Text:TutorialDraw[MAX_PLAYERS][2];
  78.  
  79. // Forward's
  80. forward YaPuedePasar(playerid);
  81. forward TutorialCargar(playerid);
  82. forward MostrarLogin(playerid);
  83. forward CargarInfo_datos(playerid,name[],value[]);
  84.  
  85. main(){
  86.  
  87.     printf("* Información: Gamemode Roleplay.\n\n* Créditos.\n    * Creado con el tutorial de %s\n    * Por %s\n", CREADO_CON_TUTO_DE, YO_PROGRAMADOR);
  88. }
  89.  
  90. stock CargarTextdraws()
  91. {
  92.         /* Caja para el tutorial */
  93.         CajaSola =
  94.         TextDrawCreate(661.000000, 150.000000, "_");
  95.         TextDrawBackgroundColor (CajaSola, 255);
  96.         TextDrawFont            (CajaSola, 1);
  97.         TextDrawLetterSize      (CajaSola, 0.500000, 13.000000);
  98.         TextDrawColor           (CajaSola, -1);
  99.         TextDrawSetOutline      (CajaSola, 0);
  100.         TextDrawSetProportional (CajaSola, 1);
  101.         TextDrawSetShadow       (CajaSola, 1);
  102.         TextDrawUseBox          (CajaSola, 1);
  103.         TextDrawBoxColor        (CajaSola, 493813612);
  104.         TextDrawTextSize        (CajaSola, -30.000000, 0.000000);
  105.         TextDrawSetSelectable   (CajaSola, 0);
  106.  
  107.         /* Info en el tutorial */
  108.         TeclaInfo =
  109.         TextDrawCreate(346.000000, 250.000000, "Presiona la tecla 'Y' cada 6 segundos para pasar..");
  110.         TextDrawBackgroundColor (TeclaInfo, 255);
  111.         TextDrawFont            (TeclaInfo, 3);
  112.         TextDrawLetterSize      (TeclaInfo, 0.310000, 1.600000);
  113.         TextDrawColor           (TeclaInfo, -1);
  114.         TextDrawSetOutline      (TeclaInfo, 1);
  115.         TextDrawSetProportional (TeclaInfo, 1);
  116.         TextDrawSetSelectable   (TeclaInfo, 0);
  117. }
  118.  
  119. public OnGameModeInit()
  120. {
  121.     // Configuración, esto no lo toquen, se edita allį arriba en los macros.
  122.     SendRconCommand("hostname " NOMBRE_SERVER);
  123.     SetGameModeText(GAMEMODE_TEXTO);
  124.     SendRconCommand("weburl " WEB_SERVER);
  125.     SendRconCommand("rcon_password " PASS_RCON);
  126.     SendRconCommand("mapname "MAPA_SERVER);
  127.    
  128.     /* Esto si */
  129.     SetWorldTime(23); // Con esto siempre serį de noche
  130.     UsePlayerPedAnims();
  131.  
  132.     CargarTextdraws(); // Carga textdraw's.
  133.  
  134.     for (new i = 0; i < MAX_PLAYERS; i++){
  135.         TutorialDraw[i][0]  = TextDrawCreate(310.000000, 157.000000, "~R~ROLEPLAY SIGNIFICA");
  136.         TextDrawAlignment(TutorialDraw[i][0] , 2);
  137.         TextDrawBackgroundColor(TutorialDraw[i][0] , 255);
  138.         TextDrawFont(TutorialDraw[i][0] , 1);
  139.         TextDrawLetterSize(TutorialDraw[i][0] , 0.330000, 1.800000);
  140.         TextDrawColor(TutorialDraw[i][0] , -1);
  141.         TextDrawSetOutline(TutorialDraw[i][0] , 0);
  142.         TextDrawSetProportional(TutorialDraw[i][0] , 1);
  143.         TextDrawSetShadow(TutorialDraw[i][0] , 1);
  144.         TextDrawSetSelectable(TutorialDraw[i][0] , 0);
  145.  
  146.         TutorialDraw[i][1]  = TextDrawCreate(310.000000, 182.000000, "~W~Bienvenido al servidor, recuerda que es roleplay y lalalalalalala tatatatatatatatataa~N~Tatata LAlalalala Y LAlalalal Y no se");
  147.         TextDrawAlignment(TutorialDraw[i][1] , 2);
  148.         TextDrawBackgroundColor(TutorialDraw[i][1] , 255);
  149.         TextDrawFont(TutorialDraw[i][1] , 1);
  150.         TextDrawLetterSize(TutorialDraw[i][1] , 0.230000, 1.300000);
  151.         TextDrawColor(TutorialDraw[i][1] , -1);
  152.         TextDrawSetOutline(TutorialDraw[i][1] , 0);
  153.         TextDrawSetProportional(TutorialDraw[i][1] , 1);
  154.         TextDrawSetShadow(TutorialDraw[i][1] , 1);
  155.         TextDrawSetSelectable(TutorialDraw[i][1] , 0);
  156.         SetSpawnInfo(i, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
  157.     }
  158.     return 1;
  159. }
  160.  
  161. stock RegistrarJugador(playerid, password[]){
  162.     if(IsPlayerConnected(playerid)){
  163.         new INI:File = INI_Open(UserPath(playerid));
  164.         INI_SetTag(File,"datos");
  165.         INI_WriteString(File,"Contra", password);
  166.         INI_Close(File);
  167.         SetPVarInt(playerid, "HaLogueado", 1);
  168.         SetPlayerPos(playerid, 2770.641113, -1871.648925, 22.665542);
  169.         InterpolateCameraPos(playerid, 2770.641113, -1871.648925, 22.665542, 2761.425292, -1992.413574, 18.984594, 12000);
  170.         InterpolateCameraLookAt(playerid, 2770.638427, -1876.626953, 22.197479, 2764.325683, -1996.359497, 17.975938, 6000);
  171.  
  172.         ShowPlayerDialog(playerid, DIALOG_SEXO, DIALOG_STYLE_MSGBOX, "Registro de sexo.", "{37B9F5}æQué sexo?", "Masculino", "Femenino");
  173.     }
  174.     return 1;
  175. }
  176.  
  177. // Loguear jugador.
  178. stock LogearJugador(playerid){
  179.     SetPlayerColor(playerid,-1);
  180.     new string[150];
  181.  
  182.     format(string, sizeof(string), "Bienvenido %s!", NombreJugador(playerid));
  183.     SendClientMessage(playerid, -1, string);
  184.  
  185.     SetPVarInt(playerid, "HaLogueado", 1);
  186.     TogglePlayerSpectating(playerid, 0);
  187.     SetPlayerScore(playerid,DatosPJ[playerid][pNivel]);
  188.     GivePlayerMoney(playerid,DatosPJ[playerid][pDinero]);
  189.     SpawnPlayer(playerid);
  190.     return 1;
  191. }
  192.  
  193. // Guardarį los datos
  194. stock GuardarDatosUser(playerid){
  195.     if(IsPlayerConnected(playerid)){
  196.         if(GetPVarInt(playerid, "HaLogueado") == 1){
  197.             new Nombre_PJ[MAX_PLAYER_NAME];
  198.             GetPlayerName(playerid, Nombre_PJ, sizeof(Nombre_PJ));
  199.             if(INI_Exist(Nombre_PJ)){
  200.  
  201.                 new Archivo_PJ[13+MAX_PLAYER_NAME+1],
  202.                 Float:X, Float:Y, Float:Z, Float:angulo, // Posición X, Y, Z, A.
  203.                 Float:health, Float:chaleco; // Vida, Chaleco.
  204.  
  205.                 format(Archivo_PJ ,sizeof Archivo_PJ, ARCHIVO_L, Nombre_PJ);
  206.                 new INI:File = INI_Open(Archivo_PJ);
  207.  
  208.                 GetPlayerPos(playerid, X, Y, Z);
  209.                 GetPlayerHealth(playerid,health);
  210.                 GetPlayerArmour(playerid,chaleco);
  211.                 GetPlayerFacingAngle(playerid, angulo);
  212.  
  213.                 INI_SetTag(File,"datos");
  214.                 INI_WriteInt(File,"Admin",DatosPJ[playerid][pAdmin]);
  215.                 INI_WriteInt(File,"Nivel",DatosPJ[playerid][pNivel]);
  216.                 INI_WriteInt(File,"Sexo",DatosPJ[playerid][pSexo]);
  217.                 INI_WriteInt(File,"Edad",DatosPJ[playerid][pEdad]);
  218.                 INI_WriteInt(File,"Registrado",DatosPJ[playerid][pRegistrado]);
  219.                 INI_WriteInt(File,"Dinero",GetPlayerMoney(playerid));
  220.                 INI_WriteFloat(File,"Pos_x",X);
  221.                 INI_WriteFloat(File,"Pos_y",Y);
  222.                 INI_WriteFloat(File,"Pos_z",Z);
  223.                 INI_WriteFloat(File,"SPos_r",angulo);
  224.                 INI_WriteFloat(File,"Vida",health);
  225.                 INI_WriteFloat(File,"Chaleco",chaleco);
  226.                 INI_WriteInt(File,"VirtualWorld",GetPlayerVirtualWorld(playerid));
  227.                 INI_WriteInt(File,"Interior",GetPlayerInterior(playerid));
  228.                 INI_WriteInt(File,"RopaPuesta",DatosPJ[playerid][pRopaPuesta]);
  229.  
  230.                 INI_Close(File);
  231.             }
  232.         }
  233.     }
  234.     return 1;
  235. }
  236.  
  237. public CargarInfo_datos(playerid,name[],value[]){
  238.     INI_Int("Admin",DatosPJ[playerid][pAdmin]);
  239.     INI_Int("Nivel",DatosPJ[playerid][pNivel]);
  240.     INI_Int("Sexo",DatosPJ[playerid][pSexo]);
  241.     INI_Int("Edad",DatosPJ[playerid][pEdad]);
  242.     INI_Int("Registrado",DatosPJ[playerid][pRegistrado]);
  243.     INI_Int("Dinero",DatosPJ[playerid][pDinero]);
  244.     INI_Float("Pos_x",DatosPJ[playerid][pPos_x]);
  245.     INI_Float("Pos_y",DatosPJ[playerid][pPos_y]);
  246.     INI_Float("Pos_z",DatosPJ[playerid][pPos_z]);
  247.     INI_Float("SPos_r",DatosPJ[playerid][pPos_r]);
  248.     INI_Float("Vida",DatosPJ[playerid][pVida]);
  249.     INI_Float("Chaleco",DatosPJ[playerid][pChaleco]);
  250.     INI_Int("VirtualWorld",DatosPJ[playerid][pVirtualWorld]);
  251.     INI_Int("Interior",DatosPJ[playerid][pInterior]);
  252.     INI_Int("RopaPuesta",DatosPJ[playerid][pRopaPuesta]);
  253.     return 0;
  254. }
  255.  
  256. forward LoadUser_pass(playerid,name[],value[]);
  257. public LoadUser_pass(playerid,name[],value[]){
  258.     INI_String("Contra",DatosPJ[playerid][pKey], 32);
  259.     return 1;
  260. }
  261.  
  262. stock INI_Exist(nickname[]){
  263.     new tmp[128];
  264.     format(tmp,sizeof(tmp),ARCHIVO_L, nickname);
  265.     return fexist(tmp);
  266. }
  267.  
  268. stock UserPath(playerid){
  269.     new string[128],playername[MAX_PLAYER_NAME];
  270.     GetPlayerName(playerid,playername,sizeof(playername));
  271.     format(string,sizeof(string),ARCHIVO_L,playername);
  272.     return string;
  273. }
  274.  
  275. stock IsNumeric(string[]){
  276.     for (new i = 0, j = strlen(string); i < j; i++){
  277.         if (string[i] > '9' || string[i] < '0') return 0;
  278.     }
  279.     return 1;
  280. }
  281.  
  282. stock NombreJugador(playerid){
  283.     new NombrePJ[24];
  284.     GetPlayerName(playerid,NombrePJ,24);
  285.     new N[24];
  286.     strmid(N,NombrePJ,0,strlen(NombrePJ),24);
  287.     for(new i = 0; i < MAX_PLAYER_NAME; i++){
  288.         if (N[i] == '_') N[i] = ' ';
  289.     }
  290.     return N;
  291. }
  292.  
  293. public OnPlayerConnect(playerid)
  294. {
  295.     SendClientMessage(playerid, -1, "SERVER: CARGANDO...");
  296.     SetTimerEx("MostrarLogin", 4000, 0, "d", playerid);
  297.     return 1;
  298. }
  299.  
  300. // Mostrarį las cįmaras del inicio.
  301. stock CamarasIniciales(playerid){
  302.     SetPlayerPos(playerid, 2717.178466, -1994.410278, 13.986422);
  303.     InterpolateCameraPos(playerid, 2717.178466, -1994.410278, 13.986422, 2631.317138, -1996.975463, 18.373538, 13000);
  304.     InterpolateCameraLookAt(playerid, 2712.781494, -1996.772094, 14.283123, 2635.082763, -2000.088745, 17.311382, 6000);
  305. }
  306.  
  307. // Mostrarį los diįlogos.
  308. stock MostrarAccion(playerid){
  309.     new NombrePJ[MAX_PLAYER_NAME];
  310.     GetPlayerName(playerid, NombrePJ, MAX_PLAYER_NAME);
  311.     if(INI_Exist(NombrePJ)){
  312.         SendClientMessage(playerid, 0x13112237, "{37B9F5}<!> SERVER: {E3E4ED}Bienvenido al servidor, ingresa tu contraseńa para continuar jugando!.");
  313.         INI_ParseFile(UserPath(playerid), "LoadUser_pass", .bExtra = true, .extra = playerid);
  314.         ShowPlayerDialog(playerid,DIALOG_LOGEO,DIALOG_STYLE_PASSWORD ," ","Ingresa tu contraseńa.","Entrar","Salir");
  315.         return 1;
  316.     }
  317.     else{
  318.         SendClientMessage(playerid, 0x13112237, "{37B9F5}<!> SERVER: {E3E4ED}Bienvenido al servidor, ingresa una contraseńa para registrarte!");
  319.         ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_PASSWORD ," ","Esta cuenta no estį registrada, introduce una contraseńa.","Registrar","Salir");
  320.         return 1;
  321.     }
  322. }
  323.  
  324. public MostrarLogin(playerid){
  325.     ClearChatbox(playerid); // Limpia el chat para el usuario.
  326.     CamarasIniciales(playerid); // Coloca la cįmara de login.
  327.     MostrarAccion(playerid); // Muestra los diįlogos segśn si estį o no registrado/a.
  328.     SetPlayerVirtualWorld(playerid, playerid+324);
  329.     SetPlayerInterior(playerid, 0);
  330. }
  331.  
  332. ClearChatbox(playerid){
  333.     for(new i = 0; i < 40; i++){
  334.         SendClientMessage(playerid, -1, "");
  335.     }
  336.     return 1;
  337. }
  338.  
  339. public OnPlayerDisconnect(playerid, reason){
  340.     GuardarDatosUser(playerid);
  341.     return 1;
  342. }
  343.  
  344. public OnPlayerSpawn(playerid)
  345. {
  346.     // Cuando se registre para que vea el tutorial
  347.     if(GetPVarInt(playerid, "VeraTutorial") == 1){
  348.     PasarAlTuto(playerid);
  349.     return 1;
  350.     }
  351.    
  352.     // Esto es lo que pasarį cuando muera, irį al hospital
  353.     if(GetPVarInt(playerid, "HaMuerto") == 1){
  354.         SetPVarInt(playerid, "HaMuerto", 0);
  355.         SetPlayerPos(playerid, 1183.31, -1325.01, 13.58);
  356.         SetPlayerFacingAngle(playerid, -90);
  357.         SetPlayerSkin(playerid, DatosPJ[playerid][pRopaPuesta]);
  358.         return 1;
  359.     }
  360.  
  361.     SetPlayerPos(playerid,DatosPJ[playerid][pPos_x],DatosPJ[playerid][pPos_y],DatosPJ[playerid][pPos_z]);
  362.     SetPlayerVirtualWorld(playerid, DatosPJ[playerid][pVirtualWorld]);
  363.     SetPlayerInterior(playerid, DatosPJ[playerid][pInterior]);
  364.     SetPlayerFacingAngle(playerid, DatosPJ[playerid][pPos_r]);
  365.    
  366.     SetPlayerHealth(playerid, DatosPJ[playerid][pVida]);
  367.     SetPlayerArmour(playerid, DatosPJ[playerid][pChaleco]);
  368.     SetPlayerSkin(playerid, DatosPJ[playerid][pRopaPuesta]);
  369.     return 1;
  370. }
  371.  
  372.  
  373. public OnPlayerDeath(playerid, killerid, reason){
  374.     SetPVarInt(playerid, "HaMuerto", 1);
  375.     return 1;
  376. }
  377.  
  378. public TutorialCargar(playerid){
  379.     SetPVarInt(playerid, "ViendoTutorial", 1);
  380.     SetPVarInt(playerid, "VeraTutorial", 1);
  381.     SpawnPlayer(playerid);
  382.     return 1;
  383. }
  384.  
  385. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
  386.     if(GetPVarInt(playerid, "EstaEnTuto") == 1){
  387.         if(newkeys == KEY_YES){
  388.             if(GetPVarInt(playerid, "PuedePasar") == 0){
  389.                 return PasarAlTuto(playerid);
  390.             }
  391.             else{
  392.                 return GameTextForPlayer(playerid, "~N~~N~~N~~N~~N~~G~ESPERA 6 SEGUNDOS PARA PASAR..", 3000, 3);
  393.             }
  394.         }
  395.     }
  396.     return 1;
  397. }
  398.  
  399. stock PasarAlTuto(playerid){
  400.     if(GetPVarInt(playerid, "ViendoTutorial") == 1){
  401.         PlayAudioStreamForPlayer(playerid, "http://photoshopforo.host22.com/servidores/ZumeZero/Mente%20en%20Blanco%20-%20Borrachos%20y%20Grifos%20oficial.mp3");
  402.         ClearChatbox(playerid);
  403.        
  404.         SetPVarInt(playerid, "EstaEnTuto", 1);
  405.         SetPVarInt(playerid, "PuedePasar", 1);
  406.         SetPVarInt(playerid, "ViendoTutorial", 2);
  407.        
  408.         CamarasIniciales(playerid);
  409.        
  410.         TextDrawSetString(TutorialDraw[playerid][0] , "~r~Bienvenido al server");
  411.         TextDrawSetString(TutorialDraw[playerid][1] , "Bienvenido al servidor, te avisamos que en un roleplay no puedes cagar en la calle~N~Lalalaal Y tatatata Tarta - Mudo lala~N~Te sugerimos el comando de dudas lala.");
  412.  
  413.        
  414.         TextDrawShowForPlayer(playerid, TeclaInfo);
  415.         TextDrawShowForPlayer(playerid, TutorialDraw[playerid][1] );
  416.         TextDrawShowForPlayer(playerid, TutorialDraw[playerid][0] );
  417.         TextDrawShowForPlayer(playerid, CajaSola);
  418.        
  419.         SetTimerEx("YaPuedePasar", 5000, false, "d", playerid);
  420.     }
  421.     else if (GetPVarInt(playerid, "ViendoTutorial") == 2){
  422.         ClearChatbox(playerid);
  423.         SetPVarInt(playerid, "PuedePasar", 1);
  424.         SetPVarInt(playerid, "ViendoTutorial", 3);
  425.  
  426.         TextDrawSetString(TutorialDraw[playerid][0] , "~G~Estado de Los Santos");
  427.         TextDrawSetString(TutorialDraw[playerid][1] , "Bienvenido al servidor, te avisamos que en un roleplay no puedes cagar en la calle~N~\
  428.                                                        Lalalaal Y tatatata Tarta - Mudo lala~N~Te sugerimos el comando de dudas lala.");
  429.  
  430.         SetTimerEx("YaPuedePasar", 5000, false, "d", playerid);
  431.     }
  432.     else if (GetPVarInt(playerid, "ViendoTutorial") == 3){
  433.         ClearChatbox(playerid);
  434.         SetPVarInt(playerid, "PuedePasar", 1);
  435.         SetPVarInt(playerid, "ViendoTutorial", 4);
  436.  
  437.         TextDrawSetString(TutorialDraw[playerid][0] , "~P~Que es MG");
  438.         TextDrawSetString(TutorialDraw[playerid][1] , "Bienvenido al servidor, te avisamos que en un roleplay no puedes cagar en la calle~N~\
  439.                                                        Lalalaal Y tatatata Tarta - Mudo lala~N~Te sugerimos el comando de dudas lala.");
  440.  
  441.         SetTimerEx("YaPuedePasar", 5000, false, "d", playerid);
  442.     }
  443.     else if (GetPVarInt(playerid, "ViendoTutorial") == 4){
  444.         ClearChatbox(playerid);
  445.         SetPVarInt(playerid, "PuedePasar", 1);
  446.         SetPVarInt(playerid, "ViendoTutorial", 5);
  447.        
  448.         SetPlayerPos(playerid, 496.425262, -1535.254028, 21.594314);
  449.         InterpolateCameraPos(playerid, 496.425262, -1535.254028, 21.594314, 511.795501, -1558.237670, 29.789680, 6000);
  450.         InterpolateCameraLookAt(playerid, 497.239257, -1540.187255, 21.586820, 507.171386, -1556.408935, 29.267198, 3000);
  451.  
  452.         TextDrawSetString(TutorialDraw[playerid][0] , "~R~Que es PG");
  453.         TextDrawSetString(TutorialDraw[playerid][1] , "Bienvenido al servidor, te avisamos que en un roleplay no puedes cagar en la calle~N~\
  454.                                                        Lalalaal Y tatatata Tarta - Mudo lala~N~Te sugerimos el comando de dudas lala.");
  455.  
  456.         SetTimerEx("YaPuedePasar", 5000, false, "d", playerid);
  457.     }
  458.     else if (GetPVarInt(playerid, "ViendoTutorial") == 5){
  459.         ClearChatbox(playerid);
  460.         SetPVarInt(playerid, "ViendoTutorial", 0);
  461.         SetPVarInt(playerid, "PuedePasar", 0);
  462.         SetPVarInt(playerid, "EstaEnTuto", 0);
  463.  
  464.         TextDrawSetString(TutorialDraw[playerid][0] , "");
  465.         TextDrawSetString(TutorialDraw[playerid][1] , "");
  466.         TextDrawHideForPlayer(playerid, TutorialDraw[playerid][0] );
  467.         TextDrawHideForPlayer(playerid, TutorialDraw[playerid][1] );
  468.         TextDrawHideForPlayer(playerid, CajaSola);
  469.         TextDrawHideForPlayer(playerid, TeclaInfo);
  470.        
  471.         if(DatosPJ[playerid][pSexo] == 1){
  472.             SetPlayerSkin(playerid, 183);
  473.             DatosPJ[playerid][pRopaPuesta] = GetPlayerSkin(playerid);
  474.         }
  475.         else if(DatosPJ[playerid][pSexo] == 2){
  476.             SetPlayerSkin(playerid, 251);
  477.             DatosPJ[playerid][pRopaPuesta] = GetPlayerSkin(playerid);
  478.         }
  479.        
  480.         SetPlayerPos(playerid, 1719.77, -1705.45, 13.50);
  481.         GivePlayerMoney(playerid, 3000);
  482.         SendClientMessage(playerid, -1, "{FFFF00}SERVER: {FFFFFF}Bienvenido al servidor, recuerda que es roleplay no puedes andar golpeando.");
  483.         SendClientMessage(playerid, -1, "{FFFF00}SERVER: {FFFFFF}Recuerda visitar nuestra pįgina web: "WEB_SERVER);
  484.         SetCameraBehindPlayer(playerid);
  485.         DatosPJ[playerid][pRegistrado] = true;
  486.         SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
  487.         GuardarDatosUser(playerid);
  488.        
  489.         StopAudioStreamForPlayer(playerid);
  490.     }
  491.     return 1;
  492. }
  493.  
  494. public YaPuedePasar(playerid){
  495.     SetPVarInt(playerid, "PuedePasar", 0);
  496. }
  497.  
  498. // Diįlogos.
  499. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  500.     switch(dialogid){
  501.  
  502.     // Registro del sexo.
  503.     case DIALOG_SEXO:{ // Diįlogo
  504.          if(!response){ // Femenino
  505.             DatosPJ[playerid][pSexo] = 2;
  506.             SetPlayerSkin(playerid, 253);
  507.             DatosPJ[playerid][pRopaPuesta] = GetPlayerSkin(playerid);
  508.          }
  509.          else{ // Masculino
  510.             DatosPJ[playerid][pSexo] = 1;
  511.             SetPlayerSkin(playerid, 294);
  512.             DatosPJ[playerid][pRopaPuesta] = GetPlayerSkin(playerid);
  513.          }
  514.          ShowPlayerDialog(playerid, DIALOG_EDAD, DIALOG_STYLE_INPUT, "Registro de Edad", "{37B9F5}æQué edad tienes?", "Enviar", "");
  515.       }
  516.      
  517.     // Registro de edad.
  518.     case DIALOG_EDAD:{
  519.         if(response){
  520.             if(!IsNumeric(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EDAD, DIALOG_STYLE_INPUT, "Registro de Edad", "{37B9F5}Śnicamente nśmeros. æQué edad tienes?", "Enviar", "");
  521.             if(strval(inputtext) < 18 || strval(inputtext) > 80) return ShowPlayerDialog(playerid, DIALOG_EDAD, DIALOG_STYLE_INPUT, "Registro de Edad", "{37B9F5}Mķnimo 18, Mįximo 80. æQué edad tienes?", "Enviar", "");
  522.            
  523.             DatosPJ[playerid][pEdad] = strval(inputtext);
  524.             SetTimerEx("TutorialCargar", 3000, 0, "d", playerid);
  525.             GameTextForPlayer(playerid, "CARGANDO TUTORIAL..",3000,3);
  526.             return 1;
  527.          }
  528.          else{
  529.          ShowPlayerDialog(playerid, DIALOG_EDAD, DIALOG_STYLE_INPUT, "Registro de Edad", "{37B9F5}æQué edad tienes?", "Enviar", "");
  530.          }
  531.          return 1;
  532.      }
  533.  
  534.     // Diįlogo de logueo
  535.     case DIALOG_LOGEO:{
  536.             if(response == 1){
  537.                 if (!strcmp(inputtext,DatosPJ[playerid][pKey]))
  538.                 {
  539.                     SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
  540.                     INI_ParseFile(UserPath(playerid), "CargarInfo_datos", .bExtra = true, .extra = playerid);
  541.                     LogearJugador(playerid);
  542.                 }
  543.                 else{
  544.                     ShowPlayerDialog(playerid,DIALOG_LOGEO,DIALOG_STYLE_PASSWORD ,"Login","Contraseńa incorrecta, inténta nuevamente.","Entrar","Salir");
  545.                     return 1;
  546.                 }
  547.             }
  548.             else{
  549.                 SendClientMessage(playerid, -1, "Fuiste expulsado del servidor automįticamente.");
  550.                 Kick(playerid);
  551.             }
  552.             return 1;
  553.         }
  554.  
  555.     // Registro
  556.     case DIALOG_REGISTRO:{
  557.         if(response == 1){
  558.             if(strlen(inputtext) > 24){
  559.                 ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_PASSWORD ,"","La contraseńa debe tener como mįximo 24 carįcteres.","Registrar","Salir");
  560.                 return 1;
  561.             }
  562.             if(isnull(inputtext)){
  563.                 ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_PASSWORD,"","Ingresa una contraseńa","Registrar","Salir");
  564.                 return 1;
  565.             }
  566.             SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
  567.             RegistrarJugador(playerid,inputtext);
  568.             return 1;
  569.             }
  570.             else{
  571.                 SendClientMessage(playerid, -1, "Fuiste expulsado del servidor automįticamente.");
  572.                 Kick(playerid);
  573.             }
  574.             return 1;
  575.         }
  576.     }
  577.     return 1;
  578. }
Advertisement
Add Comment
Please, Sign In to add comment