Advertisement
Guest User

/revive

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