Advertisement
Guest User

ContagemHospitalV2

a guest
Jul 31st, 2010
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.51 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COR_AZULCLARO 0x33CCFFAA
  4.  
  5. new Contagem[MAX_PLAYERS];
  6. new TempoContagem[MAX_PLAYERS];
  7.  
  8. forward TextMorrendo(playerid);
  9. forward ContagemHospital(playerid);
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("Contagem Regressiva de Hospitalizacao");
  14.     print("     by DJLoko (Bernardo Vieira)     ");
  15.     return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20.     return 1;
  21. }
  22.  
  23. public OnPlayerDeath(playerid, killerid, reason)
  24. {
  25.     TogglePlayerControllable(playerid, 0);
  26.     GameTextForPlayer(playerid, "MORRENDO", 1500, 3);
  27.     SetTimer("TextMorrendo", 2000, 1);
  28.     return 1;
  29. }
  30.  
  31. public TextMorrendo(playerid)
  32. {
  33.     SetPlayerPos(playerid,2040.08,-1411.37,-500.16);
  34.     SetPlayerCameraPos(playerid,1992.93,-1456.59,47.10);
  35.     SetPlayerCameraLookAt(playerid,2040.08,-1411.37,17.16);
  36.     TempoContagem[playerid] = SetTimerEx("ContagemHospital", 1000, 1, "i", playerid);
  37.     Contagem[playerid] = 5;
  38.     return 1;
  39. }
  40.  
  41. public ContagemHospital(playerid)
  42. {
  43.     new string[64];
  44.     format(string, sizeof(string), "~g~Voce sera ~n~~y~socorrido em ~n~~b~%d Segundos...", Contagem[playerid]);
  45.     GameTextForPlayer(playerid, string, 1500, 3);
  46.     if(Contagem[playerid] == 0)
  47.     {
  48.         KillTimer(TempoContagem[playerid]);
  49.         SpawnPlayer(playerid);
  50.         SetPlayerHealth(playerid, 100.00);
  51.         GivePlayerMoney(playerid, -200);
  52.         SetCameraBehindPlayer(playerid);
  53.         TogglePlayerControllable(playerid, 1);
  54.         SendClientMessage(playerid, COR_AZULCLARO,"INFO: Os medicos te salvaram por pouco! Voce pagou 200$");
  55.     }
  56.     Contagem[playerid]--;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement