dylan4021

cinto veiculo

Aug 9th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.08 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new CintoPlayer[MAX_PLAYERS];
  4.  
  5. forward Levantar(playerid);
  6.  
  7. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  8. {
  9.     if(CintoPlayer[playerid] == 0)
  10.     {
  11.         new Float:Posx,
  12.             Float:Posy,
  13.             Float:Posz,
  14.             Float:Vida;
  15.         if(GetPlayerSpeed(playerid) >= 10 || GetPlayerSpeed(playerid) <= 60) {
  16.             GetVehicleHealth(vehicleid,Vida);
  17.             SetPlayerHealth(playerid,Vida-10);
  18.             SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o carro e perdeu Vida");
  19.         }
  20.         if(GetPlayerSpeed(playerid) > 60 || GetPlayerSpeed(playerid) <= 120) {
  21.             GetVehicleHealth(vehicleid,Vida);
  22.             SetPlayerHealth(playerid,Vida-30);
  23.             GetPlayerPos(playerid, Posx, Posy, Posz);
  24.             SetPlayerPos(playerid,Posx+1,Posy+1,Posz+0.5);
  25.             RemovePlayerFromVehicle(playerid);
  26.             ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  27.             SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o Carro e Saiu Voando!");
  28.             SetTimerEx("Levantar", 5000, false, "i", playerid);
  29.         }
  30.         if(GetPlayerSpeed(playerid) > 120) {
  31.             GetVehicleHealth(vehicleid,Vida);
  32.             SetPlayerHealth(playerid,Vida-60);
  33.             GetPlayerPos(playerid, Posx, Posy, Posz);
  34.             SetPlayerPos(playerid,Posx+4,Posy+4,Posz+2);
  35.             RemovePlayerFromVehicle(playerid);
  36.             ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  37.             SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o Carro e Saiu Voando!");
  38.             SetTimerEx("Levantar", 5000, false, "i", playerid);
  39.         }
  40.     }
  41.     return 1;
  42. }
  43.  
  44.  
  45. public Levantar(playerid)
  46. {
  47.     ClearAnimations(playerid);
  48.     return 1;
  49. }
  50.  
  51. stock GetPlayerSpeed(playerid)
  52. {
  53.     new Float:ST[4];                          //by Alguem, So sei que não fui eu '-'
  54.     if(IsPlayerInAnyVehicle(playerid))
  55.     GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  56.     else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  57.     ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
  58.     return floatround(ST[3]);
  59. }
Advertisement
Add Comment
Please, Sign In to add comment