Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50 //Change this to your player slot amount
- #define N2E_TIME 600000//Edit this value to change the timer, now = 10 mins
- #define LOOSING_HP 5 //The HP the player will lose
- #define COLOR_RED 0xFF6347AA
- forward NeedToEat(playerid);
- new FirstSpawn[MAX_PLAYERS];
- new Float:CurHealth[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("Zimon95");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("Zimon95");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- FirstSpawn[playerid] += 1;
- new Float:health;
- GetPlayerHealth(playerid, health);
- CurHealth[playerid] = health;
- if(FirstSpawn[playerid] == 1) SetTimerEx("NeedToEat", N2E_TIME, 1, "i", playerid);
- return 1;
- }
- public NeedToEat(playerid)
- {
- new Float:health;
- GetPlayerHealth(playerid, health);
- if(CurHealth[playerid] >= health)
- {
- SendClientMessage(playerid, COLOR_RED,"Zaczynasz powoli robić się głodny.");
- SetPlayerHealth(playerid, (health - LOOSING_HP));
- CurHealth[playerid] = health;
- }
- else
- {
- CurHealth[playerid] = health;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment