Advertisement
Nyft_

Cinto de Segurança ~NYFT

Jul 31st, 2022 (edited)
2,909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.27 KB | None | 0 0
  1. #include <a_samp>
  2. #include <pawn.cmd>
  3.  
  4. /*
  5.  
  6.     * O sistema não foi testado, é apenas uma ideia para se usar com a public "OnVehicleHealthChange".
  7.     * O sistema usa uma public adaptada quando o veículo toma algum dano:
  8.  
  9.         - Link: https://pastebin.com/BgLJFBhg
  10.  
  11. */
  12.  
  13. new bool:playerUsingSeatBelt[MAX_PLAYERS];
  14.  
  15. main(){}
  16.  
  17. public OnVehicleTakeDamage(vehicleid, playerid, Float:newhealth, Float:oldhealth)
  18. {
  19.     if(!playerUsingSeatBelt[playerid] && (oldhealth - newhealth) >= 150.0)
  20.     {
  21.         SetPlayerHealth(playerid, 0.0);
  22.         SendClientMessage(playerid, -1, "* Você morreu com uma batida muito forte e não estava com o cinto de segurança.");
  23.     }
  24.     return 1;
  25. }
  26.  
  27. CMD:cinto(playerid)
  28. {
  29.     /*
  30.  
  31.     if(GetVehicleModelType(GetPlayerVehicleID(playerid)) != VEHICLE_TYPE_CAR)
  32.         return SendClientMessage(playerid, -1, "* Você não está em um carro.");
  33.  
  34.     */
  35.  
  36.     if(!IsPlayerInAnyVehicle(playerid))
  37.         return SendClientMessage(playerid, -1, "* Você não está em nenhum veículo.");
  38.  
  39.     playerUsingSeatBelt[playerid] = ((playerUsingSeatBelt[playerid]) ? (false) : (true));
  40.     SendClientMessage(playerid, -1, ((playerUsingSeatBelt[playerid]) ? ("* Você tirou o cinto de segurança.") : ("* Você colocou o cinto de segurança.")));
  41.     return 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement