Advertisement
Guest User

SeatBelt Created by DraKon, Translated by : EHab Isaac.

a guest
Jul 9th, 2010
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.00 KB | None | 0 0
  1. //••••••••••••••••••••••••••••••••••••••••••••••••••••
  2. //•• Translated by Ehab Isaac. Created by : DraKon.
  3. #include <a_samp>
  4. #define MEUS_SLOTS 20
  5. //************ Cores **************************
  6. #define AMARELO          0xFFFF00AA
  7. #define VERDE        0x33AA33A
  8. //********** Arrays ***************************
  9. new CintoPlayer[MEUS_SLOTS];
  10. //***************** CallBakcs (Detectar Batida *****************
  11.     public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  12.     {
  13.     if(CintoPlayer[playerid] == 0)
  14.     {
  15.     new Float:Px = 0.000000, Float:Py = 0.000000, Float:Pz = 0.000000, Float:Pa = 0.000000, Float:HV ;
  16.     GetPlayerPos(playerid, Px, Py, Pz);//PEGA POS
  17.     GetPlayerFacingAngle(playerid, Pa);//PEGA ANGULO
  18.     GetVehicleHealth(vehicleid,HV);
  19.     SetPlayerHealth(playerid,HV/10);
  20.     SetPlayerPos(playerid,Px+2,Py+2,Pz+1);
  21.     RemovePlayerFromVehicle(playerid);//REMOVE VEICULO
  22.     ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  23.     ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  24.     SendClientMessage(playerid,AMARELO,"[WARNING]: See? That's happens when you evade the belt! I hope you learned from this crash that you put the seatbelt next time.");
  25.     SetTimer("ANIM",5000,0);
  26.     SetPlayerWantedLevel(playerid, 1);
  27.     }
  28.     return 1;
  29.     }
  30. //************ CallBacks Para Anims **************************
  31. forward ANIM(playerid);
  32. public ANIM(playerid)
  33. {
  34.     ClearAnimations(playerid);
  35.     return 1;
  36. }
  37. //*************** Call Backs Entra Veiculos ******************
  38. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  39. {
  40.     CintoPlayer[playerid] = 0;
  41.     GameTextForPlayer(playerid, "~r~/seatbelt, ~n~Don't Evade that! You are risking your life when you evade the SeatBelt! You can drive safely.", 3000, 4);
  42.     return 1;
  43. }
  44. //******** Call Backs Comandos *******************************
  45. public OnPlayerCommandText(playerid, cmdtext[])
  46. {
  47.     if(!strcmp(cmdtext, "/seatbelt", true))
  48.     {
  49.     CintoPlayer[playerid] = 1;
  50.     SendClientMessage(playerid,VERDE,"[SERVER]: Yes, don't evade it! You're doing great! Always when you drive, put the Seatbelt. If you want to remove it type:(/takeseatbeltoff)");
  51.     SetPlayerWantedLevel(playerid, 0);
  52.     return 1;
  53.     }
  54.     if(!strcmp(cmdtext, "/takeseatbeltoff", true))
  55.     {
  56.     CintoPlayer[playerid] = 0;
  57.     SendClientMessage(playerid,AMARELO,"[WARNING]: You are risking your life! Your life is in danger now! Don't ride anything without putting the SeatBelt.");
  58.     SetPlayerWantedLevel(playerid, 0);
  59.     return 1;
  60.     }
  61.     if(!strcmp(cmdtext, "/seatbelthelp", true))
  62.     {
  63.     SendClientMessage(playerid,AMARELO,"/seatbelt to put the Seatbelt around your body, to be safe! Drive safely now!");
  64.     SendClientMessage(playerid,AMARELO,"/takeseatbeltoff to remove the Seatbelt from around your body. That's not safe while driving!");
  65.     return 1;
  66.     }
  67.     return 0;
  68. }
  69. //*************** The End *************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement