Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #pragma tabsize 0
- #define KOLOR_CZARNY 0xFFFFFF
- /*Zmienne*/
- new string[MAX_PLAYERS];
- new str[MAX_PLAYERS];
- new fullhpcount[MAX_PLAYERS];
- new fullhptimeout[MAX_PLAYERS];
- new fullhptimeoutcount[MAX_PLAYERS];
- /*Zmienne-end*/
- /*Stocki*/
- forward timerfullhptimeout(playerid);
- forward timerfullhptimeoutcount(playerid);
- forward reklamahp();
- /*Stocki-end*/
- public OnPlayerGameMode(playerid)
- {
- SetTimer(rekalmahp, 1200000, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, KOLOR_CZARNY, "Na servwerze jest zainstalowany skrypt na HP by Mefik");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/100hp",true)==0)
- {
- new aktualnailoschp[MAX_PLAYERS] = GetPlayerHealth(playerd);
- new ilosckasygracza[MAX_PLAYERS] = GetPlayerMoney(playerid);
- new fullhp[MAX_PLAYERS] = 100;
- new fullhpcena[MAX_PLAYERS] = 10000;
- if(aktualnailoschp[playerid] >= fullhp[playerd]}
- {
- if(ilosckasygracza[playerid] <= fullhpcena[playerid])
- {
- if(fullhptimeout[playerid] == 0)
- {
- GivePlayerMoney(playerid, - fullhpcena[playerid];
- SetPlayerHealth(playerid, fullhp[playerid];
- format(str(sizeof),"Kupiles pelne HP za %dK$",fullhpcena[playerid]);
- SendClientMessage(playerid, KOLOR_CZARNY, str);
- fullhpcount[playerid] == 60;
- fullhptimeout[playerid] == 1;
- fullhptimeoutcount[playerid] == fullhpcount[playerid];
- SetTimerEx(timerfullhptimeout[playerid], 60000, 0, -d, playerid;
- SetTimerEx(timerfullhptimeoutcount[playerid], 1000, 60, -d, playerid;
- }
- else
- {
- format(str(sizeof),"HP mozna kupic raz na 60 sekund! Zostalo jeszcze %d sekund!",fullhptimeoutcount[playerid]);
- SendClientMessage(playerid, KOLOR_CZARNY, str);
- }
- else
- {
- new ilekasybrakuje[MAX_PLAYERS] == fullhpcena(playerid) - GetPlayerMoney(playerid);
- format(str(sizeof),"Odnowienie HP kosztuje %dK$! Brakuje ci jeszcze %d$!",fullhpcena[playerid], ilekasybrakuje[playerid]);
- SendClientMessage(playerid, KOLOR_CZARNY, str);
- }
- else
- {
- format(str(sizeof),"Masz juz pelne %d HP!",fullhp[playerid]);
- SendClientMessage(playerid, KOLOR_CZARNY, str);
- }
- return 1;
- }
- return SendClientMessage(playerid, KOLOR_CZARNY, "Wpisales zla komende");
- }
- public timerfullhptimeout(playerid)
- {
- fullhptimeout[playerid] == 0;
- return 1;
- }
- public timerfullhptimeoutcount(playerid)
- {
- fullhpcount[playerid] == fullhpcount[playerid]-1;
- return 1;
- }
- public reklamahp()
- {
- SendClientMessageToAll(KOLOR_CZARNY, "Na servwerze jest zainstalowany skrypt na HP by Mefik");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement