Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new idx = GetEntProp(GetPlayerWeaponSlot(client, 1), Prop_Send, "m_iItemDefinitionIndex");
- if (StrEqual(weapon3, "tf_weapon_lunchbox") && TF2_GetPlayerClass(client) != TFClass_Heavy && !pEatCooldown[client] && !pLongEatCooldown[client])
- {
- TF2_StunPlayer(client, Float:3.8, Float:0.0, TF_STUNFLAG_BONKSTUCK|TF_STUNFLAG_NOSOUNDOREFFECT, 0);
- if (idx == 42) SetSandvich(client);
- if (idx == 159) SetDalokohs(client);
- }
- SetDalokohs(client)
- {
- CreateTimer(1.0, SetDalokohsTimer, any:client, TIMER_REPEAT);
- pEatCooldown[client] = true;
- if (!pDalokohsBuff[client])
- {
- Command_Weapon(client, 2159);
- pDalokohsBuff[client] = true;
- DalokohsBuffTimer[client] = CreateTimer(30.1, DalokohsBuffTime, any:client);
- }
- if (GetClientHealth(client) < TF2_GetMaxHealth(client))
- {
- EatCooldownTimer[client] = CreateTimer(30.1, Eat_CooldownTime, any:client);
- pLongEatCooldown[client] = true;
- SetSpeshulAmmo(client, 1, 0);
- }
- else if (GetClientHealth(client) >= TF2_GetMaxHealth(client)) EatCooldownTimer[client] = CreateTimer(4.3, Eat_CooldownTime, any:client);
- }
- public Action:SetDalokohsTimer(Handle:timer, any:client)
- {
- static NumPrinted = 0;
- if (NumPrinted == 0) EmitSoundToAll("vo/SandwichEat09.wav", client);
- if (NumPrinted++ >= 4)
- {
- NumPrinted = 0;
- return Plugin_Stop;
- }
- if (GetClientHealth(client) < TF2_GetMaxHealth(client) && (GetClientHealth(client) + 15 > TF2_GetMaxHealth(client)))
- {
- SetEntityHealth(client, TF2_GetMaxHealth(client));
- return Plugin_Stop;
- }
- else if (GetClientHealth(client) < TF2_GetMaxHealth && (GetClientHealth(client) + 15) < TF2_GetMaxHealth(client))
- {
- SetEntityHealth(client, (GetClientHealth(client) + 15));
- return Plugin_Continue;
- }
- return Plugin_Continue;
- }
- public Action:Eat_CooldownTime(Handle:timer, any:client)
- {
- if(pEatCooldown[client])
- {
- pEatCooldown[client] = false;
- if (pLongEatCooldown[client])
- {
- PrintHintText(client, "[TF2Items]Randomizer: Your Food has Recharged");
- EmitSoundToClient(client, "player/recharged.wav");
- pLongEatCooldown[client] = false;
- }
- SetSpeshulAmmo(client, 1, 1);
- }
- EatCooldownTimer[client] = INVALID_HANDLE;
- }
- public Action:DalokohsBuffTime(Handle:timer, any:client)
- {
- if (pDalokohsBuff[client])
- {
- pDalokohsBuff[client] = false;
- Command_Weapon(client, 159);
- }
- SetSpeshulAmmo(client, 1, 1);
- DalokohsBuffTimer[client] = INVALID_HANDLE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement