Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include sdktools
- ConVar ProCent, Health, Time;
- Handle timeing[MAXPLAYERS+1];
- public OnPluginStart()
- {
- PrecacheModel("models/infected/hulk_dlc3.mdl", true);
- HookEvent("tank_spawn", skuka);
- HookEvent("tank_killed", skuka2);
- ProCent = CreateConVar("sm_tank_health_chance", "50", "Чё надо сцуко?", FCVAR_NONE);
- Health = CreateConVar("sm_tank_health", "1000", "Хехе бой?", FCVAR_NONE);
- Time = CreateConVar("sm_tank_timer", "5.0", "Хехе б12321321ой?", FCVAR_NONE);
- AutoExecConfig(true, "RandomHealthBosses");
- }
- public Action skuka(Event event, const char[] name, bool dontBroadcast)
- {
- int iTank = GetClientOfUserId(event.GetInt("userid"));
- char mName[56]
- GetClientModel(iTank, mName, sizeof(mName))
- if(StrEqual(mName, "models/infected/hulk.mdl"))
- {
- if(GetRandomInt(0, 100) < GetConVarInt(ProCent))
- {
- timeing[iTank] = CreateTimer(GetConVarFloat(Time), timer, iTank, TIMER_REPEAT);
- }
- }
- }
- public Action skuka2(Event event, const char[] name, bool dontBroadcast)
- {
- int deathTank = GetClientOfUserId(event.GetInt("userid"));
- if(timeing[deathTank]) // Проверяем что таймер активен и уничтожаем
- {
- KillTimer(timeing[deathTank]); // Уничтожаем таймер
- timeing[deathTank] = null; // Обнуляем значения дескриптора
- }
- }
- public Action:timer(Handle timer, any iTank)
- {
- if (IsTank(iTank))
- {
- int iHeal = GetClientHealth(iTank);
- SetEntityHealth(iTank, iHeal + GetConVarInt(Health));
- }
- }
- bool:IsTank( client )
- {
- if ( client <= 0 || !IsInfected(client) ) {
- return false;
- }
- if ( GetEntProp(client, Prop_Send, "m_zombieClass") == 8 ) {
- return true;
- }
- return false;
- }
- bool:IsInfected(client)
- {
- if (!IsClientInGame(client) || GetClientTeam(client) != 3) {
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement