Advertisement
ohreon1313

Estacionamento 1.0

Jun 21st, 2011
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 KB | None | 0 0
  1. /*Sistema de estacionamento desenvolvido por Lucas OutLawz nao remova os créditos,
  2. o uso é livre, desde que os créditos não sejam removidos.*/
  3. /*Sistema de estacionamento ainda é beta contém alguns erros que irei
  4. consertar nas próximas versões*/
  5. #include <a_samp>
  6. #include <y_objects>
  7. //===========================================cores====================================//
  8. #define Estacio 0x0000CDAA
  9. #define Estacio1 0x7FFF00AA
  10. #define Branco 0xFFFFFFAA
  11. #define Azul 0x1C86EEAA
  12. #define PREÇO 250 // Preço do estacionamento!
  13. //======================================================================================//
  14. forward ChecarEstacionamento();
  15. new Estacionamento[MAX_PLAYERS];
  16. //===================================================================================//
  17. public OnFilterScriptInit()
  18. {
  19. SetTimer("ChecarEstacionamento", 500, true);
  20. Object_Object();
  21. /*Objetos dos estacionamentos*/
  22. CreateObject(1323,2307.66699219,-1212.22705078,24.55812073,0.00000000,0.00000000,270.00000000);
  23. CreateObject(3502,2314.58862305,-1217.77246094,21.47956467,0.00000000,0.00000000,0.00000000);
  24. CreateObject(3502,2360.03271484,-1272.33740234,21.34354019,0.00000000,0.00000000,0.00000000);
  25. CreateObject(1323,2366.34497070,-1276.91687012,24.32210159,0.00000000,0.00000000,269.99804688);
  26. CreateObject(1323,2366.35205078,-1276.84130859,24.32210159,0.00000000,0.00000000,97.99450684);
  27. CreateObject(1323,2307.66699219,-1212.22656250,24.55812073,0.00000000,0.00000000,89.99450684);
  28. CreateObject(1233,1635.36560059,-1172.27343750,33.32959747,0.00000000,0.00000000,0.00000000);
  29. CreateObject(1233,1626.79577637,-1156.13854980,24.46592903,0.00000000,0.00000000,0.00000000);
  30. CreateObject(4639,1538.00427246,-1452.38464355,14.09489727,0.00000000,0.00000000,0.00000000);
  31. CreateObject(8406,2305.44775391,1383.25000000,15.34565258,0.00000000,0.00000000,0.00000000);
  32. CreateObject(8406,2305.16699219,1522.94714355,15.34565258,0.00000000,0.00000000,0.00000000);
  33. CreateObject(10837,2317.68017578,1528.25830078,13.99880409,0.00000000,0.00000000,0.00000000);
  34. CreateObject(10837,2317.44873047,1378.04724121,14.14228058,0.00000000,0.00000000,164.50000000);
  35. CreateObject(1237,2316.89453125,1522.88073730,9.82031250,0.00000000,0.00000000,0.00000000);
  36. CreateObject(1237,2315.62133789,1522.80883789,9.82031250,0.00000000,0.00000000,0.00000000);
  37. CreateObject(1237,2314.19360352,1522.88586426,9.82031250,0.00000000,0.00000000,0.00000000);
  38. CreateObject(1237,2312.68066406,1522.89916992,9.82031250,0.00000000,0.00000000,0.00000000);
  39. CreateObject(1237,2297.93627930,1383.47021484,9.82031250,0.00000000,0.00000000,0.00000000);
  40. CreateObject(1237,2299.02856445,1383.39599609,9.82031250,0.00000000,0.00000000,0.00000000);
  41. CreateObject(1237,2300.14086914,1383.47351074,9.82031250,0.00000000,0.00000000,0.00000000);
  42. CreateObject(1237,2301.29711914,1383.43310547,9.82031250,0.00000000,0.00000000,0.00000000);
  43. CreateObject(4100,2232.29931641,2032.51818848,11.44698334,0.00000000,0.00000000,320.00000000);
  44. CreateObject(4100,2246.06884766,2032.48632812,11.44698334,0.00000000,0.00000000,319.99877930);
  45. CreateObject(1237,2253.04565430,2032.54260254,9.82031250,0.00000000,0.00000000,0.00000000);
  46. CreateObject(4638,2261.71240234,2034.05664062,11.51689243,0.00000000,0.00000000,90.00000000);
  47. //================================================================================//
  48. print("\n--------------------------------------");
  49. print(" --Sistema de Estacionamento 1.0-- ");
  50. print(" FilterScript Estacionamento por ::Lucas OutLawz::");
  51. print(" Não Remova os Créditos por Favor! ");
  52. print("\n--------------------------------------");
  53. return 1;
  54. }
  55. //=============================================================================//
  56.  
  57. public OnPlayerDisconnect(playerid, reason)
  58. {
  59. Object_OnPlayerDisconnect(playerid, reason);
  60. return 1;
  61. }
  62.  
  63. public ChecarEstacionamento()
  64. {
  65. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  66. {
  67. if(!IsPlayerConnected( playerid))continue;
  68. if(PlayerToPoint(6.0, playerid, 2314.5476,-1218.2231,24.2061) && !Estacionamento[playerid])
  69. {
  70. if(IsPlayerInAnyVehicle(playerid))
  71. {
  72. GivePlayerMoney(playerid, PREÇO);
  73. TogglePlayerControllable(playerid,0);
  74. GameTextForPlayer(playerid,"~r~Pagando Estacionamento",2000,3);
  75. SendClientMessage(playerid, Estacio1, "Pagamento sendo efetuado, /estacionar para prosseguir!");
  76. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
  77. Estacionamento[playerid] = 1;
  78. }
  79. } else if(!PlayerToPoint(6.0, playerid, 2314.5476,-1218.2231,24.2061) && Estacionamento[playerid])
  80. {
  81. GameTextForPlayer(playerid,"~g~Estacionamento Pago!",1000,3);
  82. SendClientMessage(playerid, Estacio, "Pagamento Efetuado com Sucesso!");
  83. PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
  84. Estacionamento[playerid] = 0;
  85. }
  86. }
  87. }
  88. public OnPlayerCommandText(playerid, cmdtext[])
  89. {
  90. if(strcmp(cmdtext, "/estacionar", true) ==0)//Comando para liberar o carro!
  91. {
  92. SendClientMessage(playerid, Azul, "Bom dia Sr.(a)!");
  93. SendClientMessage(playerid, Branco, "Seu veiculo foi liberado estacione ou saia do estacionamento");
  94. TogglePlayerControllable(playerid,1);
  95. return 1;
  96. }
  97.  
  98. if(strcmp(cmdtext, "/info", true) ==0)//Creditos!
  99. {
  100. SendClientMessage(playerid, Branco,"=============CREDITOS==============");
  101. SendClientMessage(playerid, Azul," Criado por: Lucas OutLawz!");
  102. return 1;
  103. }
  104. return 1;
  105. }
  106. PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
  107. {
  108. new Float:oldpos[3], Float:temppos[3];
  109. GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
  110. temppos[0] = (oldpos[0] -X);
  111. temppos[1] = (oldpos[1] -Y);
  112. temppos[2] = (oldpos[2] -Z);
  113. if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  114. {
  115. return true;
  116. }
  117. return false;
  118. }
  119. /*Sistema de estacionamento desenvolvido por Lucas OutLawz nao remova os créditos,
  120. o uso é livre, desde que os créditos não sejam removidos.*/
  121. /*Sistema de estacionamento ainda é beta contém alguns erros que irei
  122. consertar nas próximas versões*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement