March 28, 2024, 03:50:33 pm

Author Topic: Charley's Attack/Defend Script  (Read 19589 times)

0 Members and 3 Guests are viewing this topic.

Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Charley's Attack/Defend Script
« on: February 22, 2012, 07:32:19 pm »
Charley's Attack/Defend Script 1.0 22/02/2012

This script was made for use with VC:MP 0.3. An updated version for use with 0.4 can be found here.

This script is in part a squirrel remake of Murid's NPT. It has various features that have been adjusted and updated but the format and bases remain the same. I thank Murid for the original script and putting work into finding all the bases. I made this script as sadly NPT is notoriously unstable and has upset many clan wars. This script should be more stable.

Attack/Defend Gamemode:

- Play in rounds
- 2 teams
- 35 bases to choose from
- One team attacks the base and one team defends
- For the attackers to win, they must either eliminate all the defenders or one of their players must stand in the base's checkpoint for 20 seconds.
- For defenders to win, they must either eliminate all the attackers or hold them off until the 10 minute timer runs out.

Features:

- 35 bases
- "Top Scorer" award each round
- Stats system (not saved on exit)
- 6 Weapon sets for players to choose from, limits on number of players who can use some sets
- Referee class
- Ability to pause rounds; add and remove players from rounds.


Download Link: http://www.sendspace.com/file/ylpiri


Note: I have not gone through and optimised this script. There are certainly better ways of doing some of the things that are done, however the improvement would be hardly noticeable ingame. This was just designed to work and to be stable, not to be perfect.
« Last Edit: March 31, 2017, 07:54:20 am by Charley »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #1 on: February 22, 2012, 08:25:30 pm »
Fixed a small bug, updated download link.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Knucis

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1784
  • Country: pt
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #2 on: February 22, 2012, 08:51:26 pm »
Really awesome :D
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Face*

  • Likes to post
  • **
  • Posts: 35
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #3 on: February 23, 2012, 07:02:56 am »
Good work bro
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor



Amenine

  • Regular
  • ***
  • Posts: 67
  • Country: in
  • Winning isn't everything , but wanting to win is.
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #4 on: February 23, 2012, 07:08:04 am »
Will be a fun ...  :D
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

O Dear LorD, You are the honor of the dishonored


  
You Dont Have The Rights Still You Behave Like The Right :o

Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #5 on: February 23, 2012, 10:06:26 am »
We can have clan wars with a working IRC echo :o

Very Very nice work!
Agree Agree x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


ToXic

  • Vice Underdog Trainee (Inactive)
  • Fanatic
  • *
  • Posts: 141
  • U BaD AsS!!!
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #6 on: February 23, 2012, 02:09:04 pm »
We can have clan wars with a working IRC echo :o

Very Very nice work!

echo in NPT

sounds good ...
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #7 on: February 23, 2012, 02:21:35 pm »
We can have clan wars with a working IRC echo :o

Very Very nice work!

echo in NPT CAD

sounds good ...
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Eddy

  • Crazy Man
  • *****
  • Posts: 947
  • Country: do
  • CTF Manager
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #8 on: February 23, 2012, 05:01:51 pm »
Nice job  ;)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


WiLsOn

  • Crazy Man
  • *****
  • *
  • *
  • *
  • Posts: 5488
  • Country: 00
  • First in battle last in retreat.
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #9 on: February 24, 2012, 08:17:36 am »
Nice script + Good job  :) ;) :thumbsup:
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor







Sora_Blue

  • Crazy Man
  • *****
  • Posts: 1179
  • Country: nl
  • ( ͡° ͜ʖ ͡°)
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #10 on: February 24, 2012, 10:22:54 am »
awesome im looking forward to see this improvement in action
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote from: Tical
All I know is you're a polack glitcher. Why are you pretending to be not a polack glitcher? Admin probably saw marcell the polack glitcher fucking around with RPG at close range, he did the right thing and banned you before you could polack glitch. Not actually being a polack glitcher could probably help

yazeen

  • Newbie
  • *
  • Posts: 13
  • Country: kp
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #11 on: February 25, 2012, 11:06:49 am »
pro script nice work  :thumbsup:

But may i ask you why did ya add:
Code: [Select]
" || " + player.Name along with all
Code: [Select]
ClientMessageToAll Commands?

Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #12 on: February 25, 2012, 12:01:26 pm »
Thats how it was on the original pawn script.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


Zeke

  • Crazy Man
  • *****
  • Posts: 935
  • Country: bg
  • VC:MP and LU beta tester
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #13 on: February 25, 2012, 12:36:15 pm »
This script is fantastic!
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote
InstallHook(0x405AC0,(DWORD)CantFindFuckingAnim,0x405A95,
CantFindFuckingAnim_HookJmpCode,sizeof(CantFindFuckingAnim_HookJmpCode));
-------------------------------------------------
Quote
[00:41:12] <~Murdock> actually just transfering files
[00:41:16] <~Murdock> sounds, clientscripts etc
[00:42:05] <heekzs> what transfer method you uses
[00:43:03] <~Murdock> speed of light

Knucis

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1784
  • Country: pt
    • View Profile
Re: Charley's Attack/Defend Script
« Reply #14 on: February 25, 2012, 03:36:07 pm »
There were some bugs regarding the round function, which would make /c base not work, and not setting the CPCount to 20 when you finish a round.

Just replace this on the function.nut (line 87) :
Code: [Select]
function RoundUpdate()
{
AttHp = 0;
DefHp = 0;
if (RoundActive == false)
{
UpdateTimer.Stop();
local i = 0, p = GetPlayers();
while (i <= p)
{
local plr = FindPlayer(i);
if (plr)
{
if (plr.IsSpawned) Announce("~r~C~b~AD", plr, 1);
}
i++;
}
return;
}

if (Paused == true) return;

SecRemain--;
if(SecRemain < 0)
    {
        SecRemain = 59;
    MinRemain--;
    if(MinRemain < 0)
    {
ClientMessageToAll("Base time exceeded", 255,127,36);
    EndRound(1);
    return;
    }
    }

if(PlayerInCP != -1)
    {
        if(IsPlayerInCP(PlayerInCP) == true)
        {
CPCount--;
if(CPCount == 0)
{
    EndRound(3);
CPCount = 20;
    return;
    }
  }
  else
  {
PlayerInCP = -1;
CPCount = 20;
  }
    }
local i = 0, p = GetPlayers(), aalive = 0, dalive = 0;

while (i <= p)
{
local plr = FindPlayer(i);
if (plr)
{
if (pinfo[i].InRound)
{
if (pinfo[i].Side == "Att")
{
aalive++;
AttHp += plr.Health;
AttHp += plr.Armour;
plr.Score = (plr.Health + plr.Armour);
if (PlayerInCP == -1)
{
if (IsPlayerInCP(i))
{
PlayerInCP = i;
}
}

}
else if (pinfo[i].Side == "Def")
{
dalive++;
DefHp += plr.Health;
DefHp += plr.Armour;
plr.Score = (plr.Health + plr.Armour);

}
}
}
i++;
}
local y = 0, h = GetPlayers();
while (y <= h)
{
local plr = FindPlayer(y);
if (plr)
{
if (plr.IsSpawned)
{
if (PlayerInCP == -1)
{
if (SecRemain > 9)
{
Announce("~b~" + MinRemain + ":" + SecRemain, plr, 1);
}
else Announce("~b~" + MinRemain + ":0" + SecRemain, plr, 1);
}
else Announce("~y~ " + CPCount, plr, 1);
}
}
y++;
}
if ((aalive < 1) || dalive < 1) Debug();

}

function.nut: 542
Code: [Select]
function round(num, idp)
{
local mult = 10 ^ idp.tointeger();
return floor( num * mult + 0.5 ) / mult;
}

main.nut: 230
Code: [Select]
else if (cmd == "base")
{
if (RoundActive)
{
local dist = distance(player.Pos.x, player.Pos.y, CurrentCP.x, CurrentCP.y);
local dir = direction(player.Pos.x, player.Pos.y, CurrentCP.x, CurrentCP.y);
if (dist > 1000) dist = round((dist/1000), 2) + "Km";
else dist = round(dist, 2) + "m";
ClientMessage("Base: " + Bases[CurrentBase].Name + ", " + dist + " " + dir, player, 255,127,36);
}
else ClientMessage("Round is not active.", player, 255,127,36);
}

And hopefully it will work.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor