Advertisement
Guest User

Sistema de blindagem, by ziiQz.

a guest
Jan 9th, 2023
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4.  
  5. #define NUMERO_CARROS 1000 //Altere conforme a quantidade existente em seu gamemode.
  6.  
  7.  
  8. new blindziiQz[MAX_VEHICLES];
  9. new blindadinho[MAX_PLAYERS] = 0;
  10. new string[128];
  11.  
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("==============================================");
  16. print("= Sistema de blindagem, by ziiQz. =");
  17. print("==============================================");
  18. SetTimer("comprarblinddenovo", 60000, true);
  19. SetTimer("ziiQzblind", 500, true);
  20. return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25. return 1;
  26. }
  27.  
  28. //FUNÇÃO
  29. public OnVehicleDeath(vehicleid, killerid)
  30. {
  31. blindziiQz[GetPlayerVehicleID(vehicleid)] = 0;
  32. return 1;
  33. }
  34.  
  35. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  36. {
  37. if(!success)
  38. {
  39. format(string, sizeof(string), "[ATENÇÃO] {FFFFFF}O comando {FF0000}%s {FFFFFF}é inválido.", cmdtext);
  40. return SendClientMessage(playerid, 0xFF0000FF, string);
  41. }
  42. return 1;
  43. }
  44.  
  45. forward ziiQzblind(vehicleid, playerid);
  46. public ziiQzblind(vehicleid, playerid)
  47. {
  48. for(new car = 1; car <= NUMERO_CARROS; car++)
  49. {
  50. if(blindziiQz[car] > 0)
  51. {
  52. new Float:health;
  53. GetVehicleHealth(car, health);
  54. if(health < 999)
  55. {
  56. blindziiQz[car] -= 5;
  57. RepairVehicle(car);
  58. return 0;
  59. }
  60. }
  61. }
  62. return 1;
  63. }
  64.  
  65. forward comprarblinddenovo(playerid);
  66. public comprarblinddenovo(playerid)
  67. {
  68. SendClientMessage(playerid, 0xFFFFFFFF, "Você já pode comprar uma blindagem novamente.");
  69. blindadinho[playerid] = 0;
  70. return 1;
  71. }
  72.  
  73. //COMANDOS
  74. CMD:ajudablindagem(playerid)
  75. {
  76. SendClientMessage(playerid, 0x1FF905FF, "•.•.•.•.•.•.•. SISTEMA DE BLINDAGEM .•.•.•.•.•.•.•");
  77. SendClientMessage(playerid, 0xFFFFFFFF, "• /blindar - Compre uma blindagem. (R$ 35.000) •");
  78. SendClientMessage(playerid, 0xFFFFFFFF, "• /blindagem - Verifica a blindagem do veículo. •");
  79. SendClientMessage(playerid, 0xFFFFFFFF, "• /ajudablindagem - Comandos e informações. •");
  80. return true;
  81. }
  82.  
  83. CMD:blindar(playerid)
  84. {
  85. if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, 0xFFFFFFFF, "Para você comprar uma blindagem , você precisa estar em um carro.");
  86. if(GetPlayerMoney(playerid) < 35000)return SendClientMessage(playerid, 0xFFFFFFFF, "Você não tem esse dinheiro todo.");
  87. if(blindadinho[playerid] == 1)return SendClientMessage(playerid, 0xFFFFFFFF, "Você já está blindado.");
  88. new idcarro = GetPlayerVehicleID(playerid);
  89. blindadinho[playerid] = 1;
  90. GivePlayerMoney(playerid, -35000);
  91. blindziiQz[GetPlayerVehicleID(playerid)] = 100;
  92. RepairVehicle(GetPlayerVehicleID(playerid));
  93. ziiQzblind(idcarro, playerid);
  94. SendClientMessage(playerid, 0xFFFFFFFF, "Você comprou uma blindagem por {00FF00}35.000${FFFFFF}.");
  95. return true;
  96. }
  97.  
  98. CMD:minhablindagem(playerid, params[])
  99. {
  100. if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, 0xFFFFFFFF, "Para checar sua blindagem , você precisa estar em um veículo.");
  101. new s[100];
  102. format(s, 100, "Seu veículo ainda possui [{FF0000}%i%{FFFFFF}] de blindagem.", blindziiQz[GetPlayerVehicleID(playerid)]);
  103. SendClientMessage(playerid, 0xFFFFFFFF, s);
  104. return true;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement