DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

Need help on the Anti-Camper-Script

Modding questions, answers, help.....

Moderators: Warfare, Admin, Moderator

Post Reply
User avatar
Cassie
Veteran Member
Veteran Member
Posts: 371
Joined: Fri Dec 29, 2006 4:45 am
Location: Belgium, Ghent
Contact:

Need help on the Anti-Camper-Script

Post by Cassie »

I used all the info CannedSplam gave at PTT, and it still doesn't seem to work;
This is what I have:

Code: Select all

function CamperDamage(%tank,%loopsElapsed)
{
%loopsElapsed++;
%tank.client.player.hurtMe(5);
if ( %loopsElapsed >= 10 || $inGoal[%tank] == false)
return;
schedule(1000,false,CamperDamage(%tank,%loopsElapsed));
}

function AntiCamp::OnEnter(%db,%this,%tank)
{
if (%tank.getFlag() != -1)
return;
$inGoal[%this,%tank] = true;
schedule(5000,0,"CamperDamage",%tank);
schedule(5000,0,"CommandToClient",%tank.client,'BottomPrint',"Please Do Not Camp!",3,3);
echo(%tank.client.nameBase SPC "Is Camping!");
}

function AntiCamp::OnLeave(%db,%this,%tank)
{
$inGoal[%this,%tank] = false;
}

datablock powerupdata(AntiCamp)
 {
category = "PowerUp";
shape = "game/data/shapes/Common/AntiCamp/AntiCamp.dts";
type = "bounce";
shadow = false;
shadowAnimation = false;
startOn = true;
minOff = 1;
maxOff = 2;
Sound = "PupOnSound";
soundOff = "PupOffSound";
};

package onCreateNewGoal {

function pickGoal()
{
   if (!isObject(Goal))
   {
      new PowerUp(Goal) {
         dataBlock = DefaultGoal;
      };
      }
%posi = PickSpawnPoint("");
Goal.setTransform(%posi);
   for (%i = 0; %i < MissionCleanUp.getCount(); %i++)
   {
      %item = MissionCleanUp.getObject(%i);
      if (%item.dataBlock $= "AntiCamp") {
      %item.delete();
   }
   }
       new PowerUp(AntiCamp) {
       dataBlock = AntiCamp;
       position = %posi - 0.5;
       };
   return Goal;
   }
   };
   
ActivatePackage(OnCreateNewGoal);
(new version, some things already fixed)

- It doesn't seem to hurt anyone; (unable to find object ' ', attempting to call function "hurtMe") [FIXED]
- It's impossible to score (probably because there are 2 PowerUp's on exactly the same position?)
- The function doesn't reschedule itself.
- The BP doesn't work (that wasn't standard, added it) [FIXED]
Last edited by Cassie on Wed Feb 21, 2007 11:39 am, edited 2 times in total.
User avatar
Cassie
Veteran Member
Veteran Member
Posts: 371
Joined: Fri Dec 29, 2006 4:45 am
Location: Belgium, Ghent
Contact:

Post by Cassie »

Bump :oops:

Btw: Yes, I do have AntiCamp/AntiCamp.dts; just a transparent-made CTF-goal :lol:
User avatar
Cassie
Veteran Member
Veteran Member
Posts: 371
Joined: Fri Dec 29, 2006 4:45 am
Location: Belgium, Ghent
Contact:

Post by Cassie »

BUMP again :oops:

Please take a look at it!
UAE Dragon

Post by UAE Dragon »

ummm
i don't know anything about scripting :razz:
User avatar
ishbuu
New Brainjar
New Brainjar
Posts: 14
Joined: Fri Feb 16, 2007 7:27 pm
Contact:

Post by ishbuu »

Image
Image
User avatar
T-90
Veteran Member
Veteran Member
Posts: 167
Joined: Wed Jan 10, 2007 3:35 am
Location: Russia, Moscow, Nuclear Hideout

Post by T-90 »

Well... Dunno. Somewhere in the summer ill really take up scripting, now i can only recommend u to talk bout it w/ Art Crazy. Btw Anti Camp Script? Why do u need it?
Блин, че я здесь забыл?
User avatar
Warfare
Moderator
Moderator
Posts: 741
Joined: Thu Dec 28, 2006 2:21 pm
Location: Austin, Texas

Post by Warfare »

I have a better approach for you to try cassie...

Try using the existing goal and, using its position, determine what tanks are within a certain radius.
If they are in the radius, after a second or two, start to hurt them.

More efficient and you wont have to worry about annoying powerups.
Post Reply