Advertisement
Higor_Gamer

[FS]Outdoor 1.1

Jan 18th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.58 KB | None | 0 0
  1. #include <a_samp>
  2. #include dini
  3. #pragma tabsize 0
  4. new Placa[3];
  5. new timer[3];
  6. public OnGameModeInit()
  7. {
  8.         if(!fexist("placa.ini")) dini_Create("placa.ini");
  9.  
  10. timer[1] = SetTimer("TrocarPlaca", 1000, true);
  11.         Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  12.         SetObjectMaterialText(Placa[1], dini_Get("placa.ini","texto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  13.  
  14.         Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  15.         SetObjectMaterialText(Placa[2], dini_Get("placa.ini","SegundoTexto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  16.  
  17.     return 1;
  18. }
  19.  
  20. public OnGameModeExit()
  21. {
  22.     return 1;
  23. }
  24. public OnPlayerCommandText( playerid, cmdtext[])
  25. {
  26. if ( strcmp( cmdtext, "/msgplaca", true)   == 0)
  27.     {
  28.     ShowPlayerDialog(playerid, 19340, DIALOG_STYLE_INPUT, "Sistema de autdoor", "Digite Ah msg que deseja:\n\n", "Mudar", "Cancelar");
  29.     return 1;
  30.     }
  31. return 1;
  32. }
  33. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  34. {
  35. if(dialogid == 19341)
  36.     {
  37.         new string[128];
  38.         if(strlen(inputtext) < 1 || strlen(inputtext) > 30) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
  39.         else
  40.         {
  41.             format(string, sizeof(string), "Você mudou o texto do autdoor para '%s'.", inputtext);
  42.             SendClientMessage(playerid, 0x33CCFFAA, string);
  43.             DestroyObject(Placa[2]);
  44.  
  45.             dini_Set ("placa.ini", "SegundoTexto", inputtext);
  46.  
  47.             Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  48.             SetObjectMaterialText(Placa[2], inputtext, 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  49.         }
  50.     }
  51. if(dialogid == 19340)
  52.     {
  53.         new string[128];
  54.         if(strlen(inputtext) < 1 || strlen(inputtext) > 30) return SendClientMessage(playerid, 0xAFAFAFAA, "Texto Invalido.");
  55.         else
  56.         {
  57.             format(string, sizeof(string), "Você mudou o texto do autdoor para '%s'.", inputtext);
  58.             SendClientMessage(playerid, 0x33CCFFAA, string);
  59.             DestroyObject(Placa[1]);
  60.  
  61.             dini_Set ("placa.ini", "texto", inputtext);
  62.  
  63.             Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  64.             SetObjectMaterialText(Placa[1], inputtext, 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  65.             ShowPlayerDialog(playerid, 19341, DIALOG_STYLE_INPUT, "Sistema de autdoor", "Digite Ah segunda msg que deseja:\n\n", "Mudar", "Cancelar");
  66.         }
  67.     }
  68. return 1;
  69. }
  70. forward TrocarPlaca();
  71. public TrocarPlaca()
  72. {
  73.     DestroyObject(Placa[2]);
  74.     Placa[1] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  75.     SetObjectMaterialText(Placa[1], dini_Get("placa.ini","texto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  76.     KillTimer(timer[1]);
  77.     timer[2] = SetTimer("MudarPlaca", 1000, true);
  78.     return 1;
  79. }
  80. forward MudarPlaca();
  81. public MudarPlaca()
  82. {
  83.     DestroyObject(Placa[1]);
  84.     Placa[2] = CreateObject(7914, 1538.93726, -1609.79602, 25.49941,   0.00000, 0.00000, 269.69089);
  85.     SetObjectMaterialText(Placa[2], dini_Get("placa.ini","SegundoTexto"), 0, OBJECT_MATERIAL_SIZE_256x128,"Art Post 4", 20, 0, 0xFFFFFFAA, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  86.     KillTimer(timer[2]);
  87.     timer[1] = SetTimer("TrocarPlaca", 1000, true);
  88.     return 1;
  89. }
  90. #pragma unused strtok
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement