Author Topic: Overall Help  (Read 2452 times)

Heres what i need to have my weapon do, and i cant get to work:
It needs to check if what it hit is a brick.
If its not it needs to let me tell the client something
It needs to check if the player using the weapon is super admin
If its not it needs to let me tell the client something
It needs to then set a trigger on the brick
It has to set the trigger to the size of the bricks x, y vales, but not its z
It needs to set the z to 5, and the bottom of the trigger needs to be level with the bottom of the brick.
It needs to let me delete the trigger if i hit the brick again.

I need to know things like:
Does the trigger have to be in the weapon file, or can it be in a seperate file?
Does the weapon have to be melee/ranged?
Does the trigger need anything special to be placed by a weapon?

Also how do i make a player, when hit by a weapon, to not be able to move/jet, mabey even do anything.

Also to read a file how do i read different lines, and how do i take whats in these lines, and put them into varibles?

Do the varibles have to be $, or % to get it from a text file?

I bet your wondering why i need all this, and its your right to know a little if your gunna help me. Im making an add-on that saves cash, and does one other special thing right now, but you can wait for that. It also comes with a toy i made!

Try looking at the Team DM mod's "Team Set Gun" - it has nearly everything in that list (making triggers, admin check, etc) execpt deleting it.

Code: [Select]
function blah::onCollision(%this,%obj,%col,%fade,%pos,%normal){
if(!%obj.client.isSuperAdmin)
messageclient(%obj.client,"",'Sorry, your not a Super Admin.');
         return;
      if(getSubStr(%col.dataBlock,0,5) !$= "brick"){   //not sure if thats checking if its not a brick.
messageclient(%obj.client,"",'This is not a brick');
} else {
// the thingy for setting trigger size
%i = new Trigger() {
            position = %pos;
            rotation = "1 0 0 0";
            scale = "3 24 3";
            dataBlock = Nameoftrigger;
            polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
         };

I think thats right. Im Sure other people will correct it if its wrong.

why change if(getSubStr(%col.dataBlock,0,5) !$= "brick") to yours? My way of checking for a brick worked fine just want to know why you changed it?



The Block Mesa Research Team!

Your starting to scare me.

Yes, that would make a trigger. But that would make a small trigger. So if  you hit a 64x64 with it you'd need to go to the center to enter said trigger...

Fixed:

Quote
function blah::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   if(!%obj.client.isSuperAdmin)
   {
   messageclient(%obj.client,"",'Sorry, your not a Super Admin.');
    return;
   }

%data = BrickData;
   //I made up BrickData because i don't know the name of the datablock for bricks
   // change if it you want it to work

   if(%col.getClassname !$= "fxDTSBrick")
      messageclient(%obj.client,"",'This is not a brick');
   else
   {
// the thingy for setting trigger size
%i = new Trigger() {
            position = %pos;
            rotation = "1 0 0 0";
            scale = "3 24 3";
            dataBlock = Nameoftrigger;
            polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
         };
}

But you have to add ephi's bit of script to set the trigger's size to that of the brick.

Actually fixed.
why change if(getSubStr(%col.dataBlock,0,5) !$= "brick") to yours? My way of checking for a brick worked fine just want to know why you changed it?
It's unnecessary D:

if(getSubStr(%col.dataBlock,0,5) !$= "brick") works. I used it in my Tag Script.

Thanks guys, and I know how to spell that stuff, but I was typing fast.