Vice Underdogs
Scripting => Script Showroom => Topic started by: Charley 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 (http://forum.vc-mp.org/?topic=2015.30).
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.
-
Fixed a small bug, updated download link.
-
Really awesome :D
-
Good work bro
-
Will be a fun ... :D
-
We can have clan wars with a working IRC echo :o
Very Very nice work!
-
We can have clan wars with a working IRC echo :o
Very Very nice work!
echo in NPT
sounds good ...
-
We can have clan wars with a working IRC echo :o
Very Very nice work!
echo in NPT CAD
sounds good ...
-
Nice job ;)
-
Nice script + Good job :) ;) :thumbsup:
-
awesome im looking forward to see this improvement in action
-
pro script nice work :thumbsup:
But may i ask you why did ya add:
" || " + player.Name
along with all ClientMessageToAll
Commands?
-
Thats how it was on the original pawn script.
-
This script is fantastic!
-
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) :
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
function round(num, idp)
{
local mult = 10 ^ idp.tointeger();
return floor( num * mult + 0.5 ) / mult;
}
main.nut: 230
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.
-
Thanks Knucis, updated download link.
-
This script is fantastic!
-
theres a bug with set 4 if you choose it you keep the m4 from set 0 and also have the m60
-
Charley please check the command "end". It kills the server when you use it during a round.
-
Remove line 387 as a temporary fix. I'll add a permanent one when people can connect to my server again, which should hopefully be tomorrow.
-
onScriptLoad last line:
local player;
for ( local i = 0; i <= GetMaxPlayers(); i++ )
{
player = FindPlayer( i );
if ( player ) pinfo[i] = PlayerInfo();
}
Funny fix. I heard you had problems with reloading scripts.
If you want to hide enemies, put it in onPlayerSpawn:
local plr;
for ( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( plr )
{
if ( plr.Team != player.Team )
{
player.RemoveLocalMarker( plr );
plr.RemoveLocalMarker( player );
}
}
}
If I find free time, I'll optimize these scripts a bit.
-
Mind if I provide a mirror download link?
-
Go ahead, you'll have to keep an eye out though as I'm hoping to release a revised edition soon(ish). Probably around the first week of April.
-
dont forget about set 4 its still giving a m4 with the m60
-
Well I can wait until the "final" version of the script.
-
Just saw this thread, so thought of posting bugs we encountered as we also use the same script on our training server
1. It happens at time that it doesnt let you choose a set and says already many players with that set, or at times suppose if i do !set 1 and then !set 2 then i have weapons of both sets...
2. I guess when we put someone in set selection, there isnt any loading bar.
3. starting random bases instead of specific ones made some players crash everytime.
4. The vehicles dont respawn after round has ended, the still remain at their last position where they were left.
5. sometimes the checkpoint timer increases to infinity in negative form (-1,-2,-3 and so on) to solve this we just get out of pickup and get back in.
these are the core ones that i remember...i might post more later if i recall any...
but yea since it was made in a hurry so thats quite expected so yea I would like to thank charley for the script and putting it up for download as we atleast have some playable script other then having nothing...
-
Hmm I'll try and release a little update asap
Edit- I've edited the download link with an updated version.
It should have fixed all the mentioned bugs. There is still no loading bar in setchoice though.
-
Haha Nice Work Charley
Link Broken
-
Haha Nice Work Charley
Link Broken
This thread is three years old and the script was written for 0.3 anyway.
-
i will convert it please any link?
-
i will convert it please any link?
We made this scripting board on the VU forums so that people like you wouldn't start posting stuff like this. Please, give up.
This script was for 0.3, and there's no way you can convert it for 0.4.
-
ok sorry i can't convert but please give me this script
-
ok sorry i can't convert but please give me this script
(https://viceunderdogs.com/proxy.php?request=http%3A%2F%2Fi1160.photobucket.com%2Falbums%2Fq490%2FMeluu_Amezagaa%2Ftumblr_m9sgey9TN21rt9tnd.gif&hash=203e1432ed697a338c500444b2fce4a99733c5b1)
-
ok sorry i can't convert but please give me this script
Get lost.
-
ok sorry i can't convert but please give me this script
I blame people like you for ruining VC:MP's reputaion.
-
Download link dead :o :o
-
Go jump off roof and die.
-
Go jump off roof and die.
-
@klein.
Clickhere (http://www.youareanidiot.org/)
-
Can you give me the link of this script attack and defence
-
Can you give me the link of this script attack and defence
Hey pagal, i've not written this script nor do i have any scripting knowledge. But i can quite confidently tell you that whatever this script was intended for it is no longer useful for that purpose. You also may have noticed that this thread is from the year 2012 which is quite sufficient to understand that bumping it or asking for a download link can result in a negative response.
PS: if someone would lock this topic that could be helpful imo.
-
This is the real script (http://forum.vc-mp.org/?topic=2015.0)
I apologize if,i did wrong post
-
This is the real script (http://forum.vc-mp.org/?topic=2015.0)
I apologize if,i did wrong post
Thanks, I've updated the first post. It links to not the 'real' script, but the one that is an updated version of this one.
-
Okay,Welcome