Advertisement
OtaconEvil

[FS] Descripcion Para Vehiculos DIALOG By OTACON

Jul 9th, 2013
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.82 KB | None | 0 0
  1. //============================================================================//
  2. //                                                                            //
  3. //               SCRIPT EXCLUSIVO PARA PAWNOSCRIPTING.COM                    //
  4. //                                                                            //
  5. //                  >-- DESCRIPCION PARA VEHICULOS <--                        //
  6. //                                                                            //
  7. //============================================================================//
  8.  
  9. //============================================================================//
  10. //                                                                            //
  11. //                     CREADO POR <ØTACØN> DESDE 0                            //
  12. //                                                                            //
  13. //                 FECHA DE INICIO DEL SCRIPT 29/01/2012                      //
  14. //                        ----------------------                              //
  15. //              FECHA DE FINALIZACION DEL SCRIPT 29/01/2012                   //
  16. //                                                                            //
  17. //                       PROHIBIDO ROBAR CREDITOS                             //
  18. //                                                                            //
  19. //                       ACTUALIZACION 10/02/2012                             //
  20. //                                                                            //
  21. //                 Agregado: Cuando El Vehiculo Explota,                      //
  22. //                   Si tiene Descripcion es Eliminada.                       //
  23. //                                                                            //
  24. //             Agregado: Cuando El Player Sale Del Servidor,                  //
  25. //               La Descripcion Del Vehiculo Es Eliminada.                    //
  26. //                                                                            //
  27. //============================================================================//
  28.  
  29. //============================================================================//
  30. //                                  INCLUDEs                                  //
  31. //============================================================================//
  32. #include <a_samp>
  33.  
  34. //============================================================================//
  35. //                                  DEFINESs                                  //
  36. //============================================================================//
  37. #define COLOR_VERDE 0x19793AFF
  38. #define COLOR_BLANCO 0xFFFFFFFF
  39. #define COLOR_GRIS 0x74777EFF
  40. #define COLOR_ROSA 0x9516D0FF
  41. #define MENU_DESCRIPCION 6241
  42. #define MENU_DESCRIPCION_2 3210
  43.  
  44. //============================================================================//
  45. //                                    NEWs                                    //
  46. //============================================================================//
  47. new
  48.    string[50],
  49.    Activar_Descripcion[MAX_VEHICLES],
  50.    Text3D:Descripcion[MAX_VEHICLES],
  51.    Death[MAX_VEHICLES]
  52. ;
  53. //============================================================================//
  54. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  55. //============================================================================//
  56. public OnFilterScriptInit()
  57. {
  58.     print("\n|---------------------------------------|");
  59.     print("|          Filescript por <ØTACØN>        |");
  60.     print("|   Descripcion Para Vehiculo -- Cargado  |");
  61.     print("|-----------------------------------------|\n");
  62.     return 1;
  63. }
  64. //============================================================================//
  65. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  66. //============================================================================//
  67. public OnFilterScriptExit()
  68. {
  69.     print("\n|---------------------------------------|");
  70.     print("|          Filescript por <ØTACØN>        |");
  71.     print("|   Descripcion Para Vehiculo -- Cerrado  |");
  72.     print("|-----------------------------------------|\n");
  73.     return 1;
  74. }
  75. //============================================================================//
  76. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  77. //============================================================================//
  78. public OnPlayerConnect(playerid)
  79. {
  80.     for(new i=0; i<MAX_VEHICLES; i++)
  81.     {
  82.        Death[i] = 0;
  83.     }
  84.     return 1;
  85. }
  86. //============================================================================//
  87. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  88. //============================================================================//
  89. public OnPlayerDisconnect(playerid, reason)
  90. {
  91.     new vehicleid = GetPlayerVehicleID(playerid);
  92.     if(Death[vehicleid] >= 1)
  93.     {
  94.        Delete3DTextLabel(Descripcion[vehicleid]);
  95.        Activar_Descripcion[vehicleid] = 0;
  96.        Death[vehicleid] = 0;
  97.     }
  98.     return 1;
  99. }
  100. //============================================================================//
  101. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  102. //============================================================================//
  103. public OnVehicleDeath(vehicleid)
  104. {
  105.     if(Death[vehicleid] >= 1)
  106.     {
  107.        Delete3DTextLabel(Descripcion[vehicleid]);
  108.        Activar_Descripcion[vehicleid] = 0;
  109.        Death[vehicleid] = 0;
  110.     }
  111.     return 1;
  112. }
  113. //============================================================================//
  114. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  115. //============================================================================//
  116. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  117. {
  118.     if(dialogid == MENU_DESCRIPCION)
  119.     {
  120.         if(response)
  121.         {
  122.             new vehicleid = GetPlayerVehicleID(playerid);
  123.             if(strlen(inputtext) != 0)
  124.             {
  125.                 if(Activar_Descripcion[vehicleid] == 0)
  126.                 {
  127.                     format(string, sizeof(string), "- %s -", inputtext);
  128.                     Descripcion[vehicleid] = Create3DTextLabel(string, COLOR_ROSA, 30.0, 40.0, 5.0, 40.0, 1);
  129.                     Attach3DTextLabelToVehicle( Descripcion[vehicleid], vehicleid, 0.0, 0.0, 1.2);
  130.                     SendClientMessage(playerid, COLOR_GRIS, "    [ ! ] Usted Ha Puesto Una Descripcion Al Vehiculo!.");
  131.                     SendClientMessage(playerid, COLOR_GRIS, "    [ ! ] Escribe: /BorrarDescripcion Para Borrar La Descripcion Actual!.");
  132.                     Activar_Descripcion[vehicleid] = 1;
  133.                     Death[vehicleid] = 1;
  134.  
  135.                     format(string, sizeof(string), "    [ - ] La Descripcion Del Vehiculo Dice: %s",inputtext);
  136.                     SendClientMessage(playerid, COLOR_BLANCO, string);
  137.                     return 1;
  138.                 }
  139.             }
  140.             else
  141.             {
  142.                 format(string, sizeof(string), "{ffffff}Escribe Una Descripcion Para Tu Vehiculo:");
  143.                 ShowPlayerDialog(playerid,MENU_DESCRIPCION,DIALOG_STYLE_INPUT,"Descripcion del Vehiculo:",string,"Escribir","Cerrar");
  144.             }
  145.         }
  146.     }
  147. //============================================================================//
  148. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  149. //============================================================================//
  150.     if(dialogid == MENU_DESCRIPCION_2)
  151.     {
  152.         if(response)
  153.         {
  154.             new vehicleid = GetPlayerVehicleID(playerid);
  155.             if(Activar_Descripcion[vehicleid] == 1)
  156.             {
  157.                 Delete3DTextLabel(Descripcion[vehicleid]);
  158.                 Activar_Descripcion[vehicleid] = 0;
  159.                 Death[vehicleid] = 0;
  160.                 SendClientMessage(playerid, COLOR_VERDE, "    [ ! ] Usted Ha Borrado La Descripcion Del Vehiculo!.");
  161.                 return 1;
  162.             }
  163.         }
  164.     }
  165.     return 1;
  166. }
  167. //============================================================================//
  168. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  169. //============================================================================//
  170. public OnPlayerCommandText(playerid, cmdtext[])
  171. {
  172.     if (strcmp("/BorrarDescripcionV", cmdtext, true, 10) == 0)
  173.     {
  174.         if(!IsPlayerInAnyVehicle(playerid))
  175.         {
  176.             SendClientMessage(playerid, COLOR_VERDE, "    [ ! ] Usted No Se Encuentra En Un Vehiculo.");
  177.             return 1;
  178.         }
  179.         if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  180.         {
  181.             SendClientMessage(playerid, COLOR_VERDE, "    [ ! ] Usted No Esta Como Conductor del Vehiculo.");
  182.             return 1;
  183.         }
  184.         new vehicleid = GetPlayerVehicleID(playerid);
  185.         if(Activar_Descripcion[vehicleid] == 1)
  186.         {
  187.             format(string, sizeof(string), "{ffffff}¿Desea Borrar La Descripcion Del Vehiculo?");
  188.             ShowPlayerDialog(playerid,MENU_DESCRIPCION_2,DIALOG_STYLE_MSGBOX,"Descripcion del Vehiculo:",string,"Borrar","Cerrar");
  189.             return 1;
  190.         }
  191.     }
  192. //============================================================================//
  193. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  194. //============================================================================//
  195.     if (strcmp("/DescripcionV", cmdtext, true, 10) == 0)
  196.     {
  197.         if(!IsPlayerInAnyVehicle(playerid))
  198.         {
  199.             SendClientMessage(playerid, COLOR_VERDE, "    [ ! ] Usted No Se Encuentra En Un Vehiculo.");
  200.             return 1;
  201.         }
  202.         if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  203.         {
  204.             SendClientMessage(playerid, COLOR_VERDE, "    [ ! ] Usted No Esta Como Conductor del Vehiculo.");
  205.             return 1;
  206.         }
  207.         new vehicleid = GetPlayerVehicleID(playerid);
  208.         if(Activar_Descripcion[vehicleid] == 0)
  209.         {
  210.             format(string, sizeof(string), "{ffffff}Escribe Una Descripcion Para Tu Vehiculo:");
  211.             ShowPlayerDialog(playerid,MENU_DESCRIPCION,DIALOG_STYLE_INPUT,"Descripcion del Vehiculo:",string,"Escribir","Cerrar");
  212.             return 1;
  213.         }
  214.     }
  215.     return 1;
  216. }
  217. //============================================================================//
  218. //                     >-- DESCRIPCION PARA VEHICULOS <--                     //
  219. //============================================================================//
  220.  
  221. //============================================================================//
  222. //                SI TE SIRVIO RESPETA EL TRABAJO DEL CREADOR                 //
  223. //                                                                            //
  224. //=========================FINAL DEL FILESCRIPT===============================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement