Guest User

Untitled

a guest
Nov 18th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. #include <a_samp>
  2. #include <ocmd>
  3. #include <sscanf2>
  4.  
  5. #define ROT 0xFF0000FF
  6.  
  7. new dead[MAX_PLAYERS], Float:deadX[MAX_PLAYERS], Float:deadY[MAX_PLAYERS], Float:deadZ[MAX_PLAYERS], deadPickup[MAX_PLAYERS];
  8.  
  9. public OnPlayerSpawn(playerid)
  10. {
  11. if(dead[playerid] == 1)
  12. {
  13. SetPlayerHealth(playerid, 1);
  14. SetPlayerPos(playerid, deadX[playerid], deadY[playerid], deadZ[playerid]);
  15. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4, 0 ,0 ,1, 0, 1);
  16. deadPickup[playerid] = CreatePickup(1313, 1, deadX[playerid], deadY[playerid], deadZ[playerid], 0);
  17.  
  18. }
  19. return 1;
  20. }
  21.  
  22. public OnPlayerDeath(playerid, killerid, reason)
  23. {
  24. GetPlayerPos(playerid, deadX[playerid], deadY[playerid], deadZ[playerid]);
  25. TogglePlayerControllable(playerid, 0);
  26. SendClientMessage(playerid, ROT, "Du bist gestorben. Ein Medic wird dich in Kürze wiederbeleben.");
  27. dead[playerid] = 1;
  28. return 1;
  29. }
  30.  
  31. ocmd:revive(playerid, params[])
  32. {
  33. if(GetPVarInt(playerid, "Fraktion") == 2)
  34. {
  35. new pID, Float:x, Float:y, Float:z, Float:health;
  36. if(sscanf(params, "u", pID)) return SendClientMessage(playerid, ROT, "/revive [ID]");
  37. GetPlayerPos(pID, x, y, z);
  38. GetPlayerHealth(pID, health);
  39. if(IsPlayerInRangeOfPoint(playerid, 2, x, y, z) && health == 1)
  40. {
  41. SetPlayerHealth(pID, 30);
  42. ClearAnimations(pID);
  43. TogglePlayerControllable(pID, 1);
  44. dead[pID] = 0;
  45. DestroyPickup(deadPickup[pID]);
  46. }
  47. }
  48. return 1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment