Guest User

Crack System

a guest
Jun 10th, 2012
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.38 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. #define COLOR_YELLOWGREEN 0x9ACD32AA
  6. #define COLOR_LIGHTRED 0xFF6347AA
  7.  
  8. new animLocked[MAX_PLAYERS];
  9.  
  10. public OnFilterScriptInit()
  11. {
  12.     print("\n--------------------------------------");
  13.     print("Crack System by Ricardo Rodrigues");
  14.     print("--------------------------------------\n");
  15.     return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20.     return 1;
  21. }
  22.  
  23. public OnVehicleStreamIn(vehicleid, forplayerid)
  24. {
  25.     if(animLocked[forplayerid] == 1)
  26.     {
  27.         RemovePlayerFromVehicle(forplayerid);
  28.         ApplyAnimation(forplayerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 0, 1);
  29.         return 1;
  30.     }
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  35. {
  36.     new Float:hp;
  37.     GetPlayerHealth(playerid, hp);
  38.     if(hp <= 80 && animLocked[playerid] == 0)
  39.     {
  40.         for(new i = 0; i < MAX_VEHICLES; i++)
  41.         SetVehicleParamsForPlayer(i, playerid, 0, 1);
  42.         animLocked[playerid] = 1;
  43.         ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 0, 1);
  44.         return 1;
  45.     }
  46.     return 0;
  47. }
  48.  
  49. CMD:cure(playerid, params[])
  50. {
  51.     new id;
  52.     if(!sscanf(params, "u", id))
  53.     {
  54.         new Float:px, Float:py, Float:pz;
  55.         GetPlayerPos(id, px, py, pz);
  56.         if(IsPlayerInRangeOfPoint(playerid, 5.0, Float:px, Float:py, Float:pz))
  57.         {
  58.             TogglePlayerControllable(id, 1);
  59.             animLocked[playerid] = 0;
  60.             SendClientMessage(id, COLOR_YELLOWGREEN, "You have been cured by a medic.");
  61.             SendClientMessage(playerid, COLOR_YELLOWGREEN, "You have just cured him. Good job.");
  62.             return 1;
  63.         }
  64.         else return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not close to the player you are trying to heal.");
  65.     }
  66.     else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /cure [PlayerID/PartOfName]");
  67. }
  68. CMD:acure(playerid, params[])
  69. {
  70.     if(IsPlayerAdmin(playerid))
  71.     {
  72.         new id;
  73.         if(!sscanf(params, "u", id))
  74.         {
  75.             TogglePlayerControllable(id, 1);
  76.             animLocked[playerid] = 0;
  77.             SendClientMessage(id, COLOR_YELLOWGREEN, "You have been cured by an admin.");
  78.             SendClientMessage(playerid, COLOR_YELLOWGREEN, "You have just cured him.");
  79.             return 1;
  80.         }
  81.         else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /acure [PlayerID/PartOfName]");
  82.     }
  83.     else return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to be logged in with RCON in order to use this command.");
  84. }
Add Comment
Please, Sign In to add comment