Author Topic: Block Protection Plugin  (Read 4049 times)

Frenzzy

  • Full Member
  • ***
  • Posts: 218
    • ICQ Messenger - 337905984
    • MSN Messenger - frenzzy@live.ru
    • View Profile
    • http://css.vsevnet.ru/
Block Protection Plugin
« on: November 28, 2010, 11:47:10 AM »
War3Source Addon - Block Protection

This addon temprorary turns off block mode for players appeared at the same location on map at spawn.

Servers running this addon: http://www.game-monitor.com/BlockProtect


Convars:

The following convars are available to customize the plugin:

Plugin version. Don't change this.

war3_blockprotect_version "1.4"

Enabled/Disabled Block Protection functionality.

war3_blockprotect_enabled "1"

How many checks before slaying blocker.
A value of 1 is approximately equal to 1 second. Not recommended to use small values, such as 1, 2 or 3.
0 - Unlimited: Checks will be working until the end of the round.


war3_blockprotect_checking_count "0"

Distance at which a player will be checked nearby.
Info: CSS player standing height: 63, crouched height: 50.


war3_blockprotect_distance "64.0"

Start block checking before end of freeze time.
0 - No: Block check start after 3 second after round start or after mp_freezetime end.
1 - Yes: Block check start immediately after round start.


war3_blockprotect_freezetime "0"

Allow players to use !noblock command.

war3_blockprotect_alllow_command "1"

Hide !noblock command in chat.

war3_blockprotect_hide_command "0"


Natives:

I also added a native interface to enable player block protection from another races / plugins:

/**
 * Make player is not solid and start block protection.
 *
 * @param client: Client index.
 * @noreturn
 */


native War3_BlockProtect(client);


Changelist:

1.0
  • Initial release.
1.1
  • Added a native interface.
  • Added translations support (also russian translation added).
  • Changed default value for convar war3_blockprotect_checking_count (now its '0').
  • Removed 'Extended' option from convar 'war3_blockprotect_type' (not needed anymore).
  • Some plugin optimizations (for example now used convar hooks).
1.2
  • Added reading values of variables from cfgs.
  • Now when war3_blockprotect_type "0", native War3_BlockProtect will operate as Advanced.
  • Removed use War3Source_Interface. Now, this addon can work without War3Source.
  • The addon is no longer using phrases for players.
  • Natives moved to "W3SIncs/BlockProtect".
1.3
  • Fixed: for(new i=0; i<MaxClients; i++) => for(new i=1; i<=MaxClients; i++)
1.4
  • Added !noblock command.
« Last Edit: January 27, 2011, 08:47:56 AM by Frenzzy »
O_o

nvn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Block Protection Plugin
« Reply #1 on: November 28, 2010, 02:32:17 PM »
Whole code was written by you?


Frenzzy

  • Full Member
  • ***
  • Posts: 218
    • ICQ Messenger - 337905984
    • MSN Messenger - frenzzy@live.ru
    • View Profile
    • http://css.vsevnet.ru/
Re: Block Protection Plugin
« Reply #2 on: November 29, 2010, 01:29:52 AM »
Whole code was written by you?
yep, have any problems?
O_o

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Block Protection Plugin
« Reply #3 on: November 29, 2010, 09:47:17 AM »
u probably know enough to start a catagorized shopmenu
« Last Edit: November 29, 2010, 02:54:26 PM by Ownz »

Schmarotzer

  • Full Member
  • ***
  • Posts: 189
  • Ich schmarotze dich!
    • ICQ Messenger - 258631507
    • View Profile
    • Russian Fan-Site for german folk-rock-metal band Schandmaul
Re: Block Protection Plugin
« Reply #4 on: November 29, 2010, 10:04:12 AM »
What do you mean, Ownz?
Welcome to my server

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: Block Protection Plugin
« Reply #5 on: November 29, 2010, 02:54:51 PM »
u probably know enough to start a catagorized shopmenu
i misspelled, now its fixed

zero

  • Full Member
  • ***
  • Posts: 194
    • View Profile
    • IBIS Gaming
    • Email
Re: Block Protection Plugin
« Reply #6 on: November 30, 2010, 03:32:45 PM »
u probably know enough to start a catagorized shopmenu
i misspelled, now its fixed

I may be able to help as I was planning on coding one after seeing the release notes in beta 7. (1.1.8.7)

Frenzzy

  • Full Member
  • ***
  • Posts: 218
    • ICQ Messenger - 337905984
    • MSN Messenger - frenzzy@live.ru
    • View Profile
    • http://css.vsevnet.ru/
Re: Block Protection Plugin
« Reply #7 on: December 02, 2010, 08:53:53 AM »
New version!

Now you can use function War3_BlockProtect() instead of your big code.

Example (conditional code):

Quote

// ... some code ...

#include "W3SIncs/BlockProtect" // Added

// ... some code ...

public OnUltimateCommand(client, race, bool:pressed)
{
    // ... some checks, target search, ect ...

    new Float:fPos[3];
    new Float:fAng[3];

    GetClientAbsOrigin(client, fPos);
    GetClientEyeAngles(client, fAng);

    TeleportEntity(target, fPos, fAng, NULL_VECTOR);

    SetEntData(target, g_iOffsetCollisionGroup, 2, 4, true);
    SetEntData(client, g_iOffsetCollisionGroup, 2, 4, true);
    CreateTimer(3.0, YourTimer, target);
    CreateTimer(3.0, YourTimer, client);

    War3_BlockProtect(target); // Added
    War3_BlockProtect(client); // Added
}

public Action:YourTimer(Handle:timer, any:client){ /* ... big code ... */ }

// ... some code ...


Players in your race are easily diverge after teleport. And you don't worry about when turned on/off players collision.
« Last Edit: January 03, 2011, 07:43:00 PM by Frenzzy »
O_o

Schmarotzer

  • Full Member
  • ***
  • Posts: 189
  • Ich schmarotze dich!
    • ICQ Messenger - 258631507
    • View Profile
    • Russian Fan-Site for german folk-rock-metal band Schandmaul
Re: Block Protection Plugin
« Reply #8 on: January 27, 2011, 09:31:43 AM »
Excellent
Welcome to my server

[Oddity]TeacherCreature

  • Sr. Member
  • ****
  • Posts: 467
    • View Profile
Re: Block Protection Plugin
« Reply #9 on: January 27, 2011, 09:43:01 AM »
Is this different than the anti stuck addon if so how?