Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.77 KB | None | 0 0
  1. #include <a_samp>
  2. #pragma tabsize 0
  3. #define KOLOR_CZARNY 0xFFFFFF
  4. /*Zmienne*/
  5. new string[MAX_PLAYERS];
  6. new str[MAX_PLAYERS];
  7. new fullhpcount[MAX_PLAYERS];
  8. new fullhptimeout[MAX_PLAYERS];
  9. new fullhptimeoutcount[MAX_PLAYERS];
  10. /*Zmienne-end*/
  11.  
  12. /*Stocki*/
  13. forward timerfullhptimeout(playerid);
  14. forward timerfullhptimeoutcount(playerid);
  15. forward reklamahp();
  16. /*Stocki-end*/
  17. public OnPlayerGameMode(playerid)
  18.     {
  19.     SetTimer(rekalmahp, 1200000, true);
  20.     return 1;
  21.     }
  22.  
  23. public OnPlayerConnect(playerid)
  24.     {
  25.     SendClientMessage(playerid, KOLOR_CZARNY, "Na servwerze jest zainstalowany skrypt na HP by Mefik");
  26.     return 1;
  27.     }
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30.     {
  31.     if(strcmp(cmdtext,"/100hp",true)==0)
  32.         {
  33.         new aktualnailoschp[MAX_PLAYERS] = GetPlayerHealth(playerd);
  34.         new ilosckasygracza[MAX_PLAYERS] = GetPlayerMoney(playerid);
  35.         new fullhp[MAX_PLAYERS] = 100;
  36.         new fullhpcena[MAX_PLAYERS] = 10000;
  37.        
  38.         if(aktualnailoschp[playerid] >= fullhp[playerd]}
  39.             {
  40.             if(ilosckasygracza[playerid] <= fullhpcena[playerid])
  41.                 {
  42.                 if(fullhptimeout[playerid] == 0)
  43.                     {
  44.                         GivePlayerMoney(playerid, - fullhpcena[playerid];
  45.                         SetPlayerHealth(playerid, fullhp[playerid];
  46.                         format(str(sizeof),"Kupiles pelne HP za %dK$",fullhpcena[playerid]);
  47.                         SendClientMessage(playerid, KOLOR_CZARNY, str);
  48.                         fullhpcount[playerid] == 60;
  49.                         fullhptimeout[playerid] == 1;
  50.                         fullhptimeoutcount[playerid] == fullhpcount[playerid];
  51.                         SetTimerEx(timerfullhptimeout[playerid], 60000, 0, -d, playerid;
  52.                         SetTimerEx(timerfullhptimeoutcount[playerid], 1000, 60, -d, playerid;
  53.                     }
  54.                     else
  55.                     {
  56.                     format(str(sizeof),"HP mozna kupic raz na 60 sekund! Zostalo jeszcze %d sekund!",fullhptimeoutcount[playerid]);
  57.                     SendClientMessage(playerid, KOLOR_CZARNY, str);
  58.                 }
  59.                 else
  60.                 {
  61.                 new ilekasybrakuje[MAX_PLAYERS] == fullhpcena(playerid) - GetPlayerMoney(playerid);
  62.                 format(str(sizeof),"Odnowienie HP kosztuje %dK$! Brakuje ci jeszcze %d$!",fullhpcena[playerid], ilekasybrakuje[playerid]);
  63.                 SendClientMessage(playerid, KOLOR_CZARNY, str);
  64.             }
  65.             else
  66.             {
  67.             format(str(sizeof),"Masz juz pelne %d HP!",fullhp[playerid]);
  68.             SendClientMessage(playerid, KOLOR_CZARNY, str);
  69.             }
  70.         return 1;
  71.         }
  72.     return SendClientMessage(playerid, KOLOR_CZARNY, "Wpisales zla komende");
  73.     }
  74.  
  75. public timerfullhptimeout(playerid)
  76.     {
  77.     fullhptimeout[playerid] == 0;
  78.     return 1;
  79.     }
  80.  
  81. public timerfullhptimeoutcount(playerid)
  82.     {
  83.     fullhpcount[playerid] == fullhpcount[playerid]-1;
  84.     return 1;
  85.     }
  86.  
  87. public reklamahp()
  88.     {
  89.     SendClientMessageToAll(KOLOR_CZARNY, "Na servwerze jest zainstalowany skrypt na HP by Mefik");
  90.     return 1;
  91.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement