Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Kunit

Pages: 1 2 3 4 5 [6] 7
76
Modification Help / Mining? messageClient
« on: June 01, 2008, 12:46:16 PM »
Hello again, Well this time I am trying to make it so that after your done mining it will say GoldOre: Number, SilverOre: Number, CopperOre: Number, But when your done mining it show's just the number like

10
6
7

Code: [Select]
//Oreearning////////////////////////////////////////////////////////////////////

function regrow(%brick){//recreate the brick
  %brick.setcolor(%brick.realcolor);//reset its color
  %brick.setcolliding(1);//make it collidable
  %brick.setraycasting(1);//make it hammerable
}

package Ore
{
    function hammerProjectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
    {
        if(!isobject(%col)){return;}//if there isnt a %col, dont continue
        if(%col.getDatablock() $= nametoid("brick2x2discData"))// nametoid(blah);
        {
            %col.hits++;//amount of hits taken plus 1
            if(%col.hits>=15){//10 hits
             %random = getRandom(1,100);
if(%random >= 1 && %random <= 10)
{
%obj.client.quantity["GoldOre"]+=getrandom(1,1);
}
else if(%random >= 11 && %random <= 30)
{
%obj.client.quantity["SilverOre"]+=getrandom(1,1);
}
else if(%random >=31 && %random <= 100)
{
%obj.client.quantity["CopperOre"]+=getrandom(1,1);
}
messageClient(%obj.client,'Ore  : %1',%obj.client.quantity["CopperOre"]);
messageClient(%obj.client,'Ore  : %1',%obj.client.quantity["GoldOre"]);
messageClient(%obj.client,'Ore  : %1',%obj.client.quantity["SilverOre"]);
             %col.realcolor = %col.getColorID();//get the bricks color
             %col.setcolor(63);//make it invisible
             %col.setcolliding(0);//make it walk-through
             %col.setraycasting(0);//make it unhammerable
             %col.hits=0;//reset the number of hits it takes
             %col.sched = schedule(15000,0,regrow,%col);//schedule the regrow in 25 seconds
         return;
        }else{return;}//otherwise return so it doesnt get hammered
        }
        Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
    }
};
ActivatePackage(Ore);

77
Modification Help / Code Help
« on: May 31, 2008, 06:28:20 PM »
Fixed Locked.

78
Modification Help / Selling?
« on: May 27, 2008, 08:47:28 PM »
Ok so im trying to make a system for my rpg that if I have say 10 ore I can type /sell ore 10 and Ill gain 50 gold Ore = 5 gold. But when I try use this and I have 10 ore and type /sell ore 10 it say's Not enough Ore, Ore:10

Code: [Select]
//Sell

$itemprices["Ore"]=5;

function serverCmdSell(%client,%item,%ammount){
$amount = $client.ore[%item];
if(%amount==0||%Amount>%client.Gold){
messageClient(%client,'','Not enough Ore!Ore: %1',%client.Ore);
return;
}
%client.Gold+=%amount;
}

79
Modification Help / Continue Through Death?
« on: May 27, 2008, 07:44:36 PM »
Ok im trying to make it so this code will continue through death any help?
Code: [Select]
function servercmdTownfolk(%client){
bottomPrintAll("\c2" @ %client.name @ " \c6 has become a Townfolk!",25,3);
%client.player.setshapename(%client.name SPC "[Is A " @ %client.Ranger @ "Townfolk]");

}

80
Modification Help / Saving Material
« on: May 26, 2008, 06:05:49 PM »
Ok well I made a money system it save's fine but I can't get it to save Ore/Wood what would I do?

Code: [Select]
//Gold

function serverCmdGrantGold(%client,%victim,%amount)
{
    if(!%client.isSuperAdmin)
        return;
    %victim = findClientByBL_ID(%victim);
    if(!isobject(%victim)){return;}//dont let them give Gold to non-existant people
    %victim.Gold+=%amount;
messageClient(%victim,'Given $%2 by %1',%client.name,%amount);
messageClient(%client,'Gave %1 $%2',%victim.name, %amount);
}

function serverCmdgiveGold(%client,%victim,%amount)
{
   if(%amount<=0||%Amount>%client.Gold)
   messageClient(%client,'','Not enough Gold! Gold: %1',%client.Gold);
    return;
    %victim = findClientByBL_ID(%victim);
    if(!isobject(%victim)){return;}//dont let them give Gold to non-existant people
    %victim.Gold+=%amount;
    %client.Gold-=%amount;
    messageClient(%victim,'Given %2 Gold by %1',%client.name,%amount);
}

 function serverCmdCheckGold(%client)
    {
       messageClient(%client,'','Gold Left : %1',%client.Gold);

}
function serverCmdSaveBank(%client){
if(%client.inBank){
%Gold = %client.Gold;
%file = new FileObject();
%file.openforRead("Add-Ons/Client/BLBank/" @ %Client.BL_Id @ ".txt");
while(!%file.isEOF())
{
%line = %file.readLine();
  switch$(firstWord(%line))
{
case "ID": %ID = restWords(%line);
case "Gold": %ExistingGold = restWords(%line);
}
}
%file.openForWrite("Add-Ons/Client/BLBank/" @ %Client.BL_Id @ ".txt");
%file.writeline("ID " @ %client.BL_ID);
%file.writeline("Gold " @ %client.Gold+%ExistingGold);
%file.close();
%file.delete();
%client.Gold = %client.Gold-%client.Gold;
Messageclient(%client,"","\c6You have successfully deposited " @ $Currency @ "\c0" @ %Gold);
CenterPrint(%client,"<just:left> < " @ ($CurrencyFront ? ($Currency @ "\c0" @ %client.Gold) : ("\c0" @ %client.Gold @ "\c6" @ $currency)) @" >",2);
%client.hasWithdrawn = 0;
}
}

function serverCmdLoadBank(%client){
if(%client.inBank && !%client.hasWithdrawn){
%client.hasWithdrawn = 1;
%file = new FileObject();
%file.openforRead("Add-Ons/client/BLBank/" @ %client.BL_ID @ ".txt");
while(!%file.isEOF())
{
%line = %file.readLine();
  switch$(firstWord(%line))
{
case "ID": %ID = restWords(%line);
case "Gold": %Gold = restWords(%line);
}
}
if(%client.BL_ID $= %ID){
%client.Gold = %client.Gold+%Gold;
%file.openForWrite("Add-Ons/client/BLBank/" @ %client.BL_ID @ ".txt");
%file.writeLine("ID " @%client.BL_Id);
%file.writeLine("Gold 0");
messageclient(%client,"","\c6You have successfully withdrawn " @ $Currency @ "\c0"  @ %Gold);
CenterPrint(%client,"<just:left> < " @ ($CurrencyFront ? ($Currency @ "\c0" @ %client.Gold) : ("\c0" @ %client.Gold @ "\c6" @ $currency)) @" >",2);
%file.close();
%file.delete();
}
}
}

function serverCmdWithdraw(%client){
if(%client.isAdmin || %client.isSuperAdmin){
%i = new Trigger() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = bankWithdraw;
            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";
            };
if(%i){
messageclient(%client,"","\c0Withdrawal \c6trigger has successfully been laid");
}
}
}

function serverCmdDeposit(%client){
if(%client.isAdmin || %client.isSuperAdmin){
%i = new Trigger() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = bankDeposit;
            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";
            };
if(%i){
messageclient(%client,"","\c0Deposition \c6trigger has successfully been laid");
}
}
}
activatepackage(Gold);

datablock TriggerData(bankDeposit){
   tickPeriodMS = 100;
};

function bankDeposit::OnEnterTrigger(%this, %trigger, %obj){
%client = %obj.client;
%client.inBank = 1;
if(%client.Gold >= "1"){
serverCmdSaveBank(%client);
}
}

function bankDeposit::OnLeaveTrigger(%this, %trigger, %obj){
%client = %obj.client;
%client.inBank = 0;
}

function bankDeposit::onTickTrigger(%trigger){}

datablock TriggerData(bankWithdraw){
   tickPeriodMS = 100;
};

function bankWithdraw::OnEnterTrigger(%this, %trigger, %obj){
%client = %obj.client;
%client.inBank = 1;
serverCmdLoadBank(%client);
}

function bankWithdraw::OnLeaveTrigger(%this, %trigger, %obj){
%client = %obj.client;
%client.inBank = 0;
}

function bankWithdraw::OnTickTrigger(%trigger){}








81
Modification Help / Brick Collision
« on: May 26, 2008, 12:51:54 PM »
Ok so Im trying to make a new brick but using the same .blb I used the http://www.blockland.us/smf/index.php?topic=13329.0 To try and get it to work and I did but the brick doesn't have any collision.
Code: [Select]
datablock fxDTSBrickData (brickRPGpinetreeData){
brickFile = "./bricks/RPGpinetree.blb";
category = "Special";
subCategory = "RPG";
uiName = "RPGtree";
iconName = "add-ons/brickIcon/RPGtree";
};

Note this is just a edit of the Brick_Example so it should have worked All of the object's are same just renamed so I want it so that there will be the normal tree brick and then the samething just with RPGtree instead of Pinetree.

82
Modification Help / Saving a trigger?
« on: May 24, 2008, 02:11:48 PM »
K tryin to basically save my trigger doesn't work with save brick's or save map help anyone? Thank's.

Code: [Select]
datablock TriggerData(topTrigger)
{
    tickPeriodMS = 10;
};
function topTrigger::onTickTrigger(%this,%trigger)
{
}
function topTrigger::onEnterTrigger(%this,%trigger,%obj)
{
    %obj.settransform(vectoradd(%obj.getposition(),%trigger.off));
}
function top::onLeaveTrigger(%this,%trigger,%obj)
{
}
datablock fxDTSBrickData(brickteletrigData : brickSpawnPointData)
{
    brickFile = "base/data/bricks/baseplates/16x16F.blb";
    uiName = "16x16x5";
    subCategory = "Teleport trigger";
};
datablock fxDTSBrickData(brickteletrig2Data : brickSpawnPointData)
{
    brickFile = "base/data/bricks/flats/1x16F.blb";
    uiName = "16x1x5";
    subCategory = "Teleport trigger";
};
datablock fxDTSBrickData(brickteletrig3Data : brickSpawnPointData)
{
    brickFile = "base/data/bricks/flats/8x8F.blb";
    uiName = "8x8x5";
    subCategory = "Teleport trigger";
};
datablock fxDTSBrickData(brickteletrig4Data : brickSpawnPointData)
{
    brickFile = "base/data/bricks/flats/1x4F.blb";
    uiName = "1x4x5";
    subCategory = "Teleport trigger";
};
function brickteletrigData::onPlant(%this,%brick)
{
    schedule(10,0,"setteletrig",%brick,16,16);
    return Parent::onPlant(%this,%brick);
}
function brickteletrig2Data::onPlant(%this,%brick)
{
    schedule(10,0,"setteletrig",%brick,16,1);
    return Parent::onPlant(%this,%brick);
}
function brickteletrig3Data::onPlant(%this,%brick)
{
    schedule(10,0,"setteletrig",%brick,8,8);
    return Parent::onPlant(%this,%brick);
}
function brickteletrig4Data::onPlant(%this,%brick)
{
    schedule(10,0,"setteletrig",%brick,4,1);
    return Parent::onPlant(%this,%brick);
}
function setteletrig(%brick,%x,%y)
{
    if(%brick.angleID==2||%brick.angleID==0)
    {
        %t=%x;%x=%y;%y=%t;
    }
    %client=%brick.client;
    echo(%client);
    if(isobject(%client.teletrig))
    {
        %client.teletrig.off=vectorsub(%brick.getposition(),%client.teletrig.brick.getposition());
        //%brick.delete();
        messageclient(%client,"","Destination placed.");
        %brick.delete();
        %client.teletrig=0;
        return 1;
    }
    if(!isobject(%brick))return;
    %pos=%brick.getposition();
    %p = new Trigger()
    {
        datablock = topTrigger;
        position = vectorAdd(%pos,-%x/4 SPC %y/4 SPC 0.1);
        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";
        scale = %x/2 SPC %y/2 SPC 3;//"8 8 3";
        rotation = "1 0 0 0";
    };
    %brick.trigger=%p;
    %client.teletrig=%p;
    %p.brick=%brick;
    messageclient(%client,"","Please place a destination(Place same brick where you want it to teleport to).");
}


83
Modification Help / Material to brick?
« on: May 21, 2008, 10:55:50 PM »
K well anyway now I got it to work but when I hammer the tree and try to spawn it will not give any material.

Code: [Select]
//MaterialBuild

package buildstuff
{
    function hammerProjectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
    {
        if(%col.getDatablock() $= "brickPineTreeData")
        {
            %obj.client.material++;
messageClient(%obj.client,'Material : %1',%obj.client.material);
        }
        Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
    }

    function serverCmdPlantBrick(%client)
    {
        if(%client.material <= 0)
        {
            messageClient(%client,'','Not enough material! Material : %1',%client.material);
            return;
        }
        if(%client.ghostbrick.getDatablock() $= "brickPineTreeData")
%client.material-=100;
else
%client.material--;
messageClient(%obj.client,'Material : %1',%obj.client.material);
        Parent::serverCmdPlantBrick(%client);
    }
};
ActivatePackage(buildstuff);

function serverCmdGiveMaterial(%client,%victim,%amount)
{
    if(!%client.isSuperAdmin)
        return;
    %victim = findClientByBL_ID(%victim);
    %victim.material+=%amount;
messageClient(%victim,'Given %1 by %2',%client.name,%amount);
}


P.S. Stop's you from getting material?

84
Help / Help Port Forwarding
« on: February 17, 2008, 05:34:12 PM »
When I host it says DEAD under ping so no one may join Why is this? Ive tried to port forward but I cant get in to my router I dont know the password and it isnt on the list.

Router made by Arris
Model CM450A
P/NTC00DA1450
Version:Touchstone
Gateway:192.168.15.1

85
Modification Help / Textures in milkshape???
« on: February 17, 2008, 02:44:41 PM »
Ok well first of all this has just started happening. After I export my model and put it in game and then I equip it, the model has a mirror effect but while in the Milkshape the model looks like the normal textures please help.

86
Modification Help / Texture's in Milkshape???
« on: February 17, 2008, 02:43:26 PM »
Ok well first of all this has just started happening. After I export my model and put it in game and then I equip it, the model has a mirror effect but while in the Milkshape the model looks like the normal textures please help.

87
Modification Help / Walking through?
« on: February 09, 2008, 12:51:10 AM »
"I am in a bit of a pickle" Lol?

After asking A few people, I've become stuck. A few people said It couldn' be done but I want to ask here just in case. Is there a code that lets you walk through bricks but not the terrain? For example in Rtb if you set some person's scale to 1 -1 -1 or as how it use to be you would fall through everything Including the terrain.  :cookieMonster:


88
Modification Help / Number Loop?
« on: February 02, 2008, 06:26:54 PM »
Could someone please post a simple code that every 30 min's (After spawning) A message will say 1 then another 30 mins later it would say 2, 3 and so on to 100, and at 100 It will end and stop counting   :cookieMonster: :cookieMonster: :cookieMonster: :cookieMonster: :cookieMonster:  Note:I already asked some people and they had no idea about the 1,2,3 and up part

89
Modification Help / Timing? And Kill
« on: January 30, 2008, 11:28:08 AM »
Is there a code for timing in a server like %if30:00 = true, Kthxbai
And also is there an on kill function that keeps total kills but not the ones you get in a row thanks in advance? cookiez :cookie: :cookie:


90
Help / Dead Server
« on: January 27, 2008, 07:00:01 PM »
When I host it says DEAD under ping so no one may join Why is this? Ive tried to port forward but I cant get in to my router I dont know the password and it isnt on the list.

Router made by Arris
Model CM450A
P/NTC00DA1450
Version:Touchstone
Gateway:192.168.15.1

Pages: 1 2 3 4 5 [6] 7