Blockland Forums > Modification Help

candlelight script

Pages: << < (3/4) > >>

Treynolds416:

You cannot use keybinds in that code. We tell you things for a goddamn reason, you need to loving listen.

Cubelands:


--- Quote from: Treynolds416 on May 11, 2012, 06:55:50 AM ---You cannot use keybinds in that code. We tell you things for a goddamn reason, you need to loving listen.

--- End quote ---
fine, I am going lock it.

--- Quote from: Treynolds416 on May 11, 2012, 07:02:10 AM ---No, unlock the thread, and try reading for once

--- End quote ---


Cubelands:

part 1 code

--- Code: ---if(!$Asciify::Binds)
{
$remapDivision[$remapCount]="Chat Asciifyer";
$remapName[$remapCount]="Toggle On/Off";
$remapCmd[$remapCount]="toggleAscii";
$remapCount++;
$Asciify::Binds=1;
}

function asciify(%str)
{
for(%a=0;%a<strLen(%str);%a++)
{
%letter = getSubStr(%str, %a, 1);
%letter[%a] = strReplace(%letter, "C", "Ç");
%letter[%a] = strReplace(%letter[%a], "c", "ç");
%letter[%a] = strReplace(%letter[%a], "u", getSubStr("üûùú", getRandom(0,3),1));
%letter[%a] = strReplace(%letter[%a], "U", "Ü");
%letter[%a] = strReplace(%letter[%a], "e", getSubStr("éêëè", getRandom(0,3),1));
%letter[%a] = strReplace(%letter[%a], "E", "É");
%letter[%a] = strReplace(%letter[%a], "a", getSubStr("âäàåá", getRandom(0,4), 1));
%letter[%a] = strReplace(%letter[%a], "A", getSubStr("ÄÅ", getRandom(0,1), 1));
%letter[%a] = strReplace(%letter[%a], "o", getSubStr("ôöòó", getRandom(0,3), 1));
%letter[%a] = strReplace(%letter[%a], "O", "Ö");
%letter[%a] = strReplace(%letter[%a], "i", getSubStr("íïîì", getRandom(0,3), 1));
%letter[%a] = strReplace(%letter[%a], "I", "î");
%letter[%a] = strReplace(%letter[%a], "f", "ƒ");
%letter[%a] = strReplace(%letter[%a], "F", "ƒ");
%letter[%a] = strReplace(%letter[%a], "n", "ñ");
%letter[%a] = strReplace(%letter[%a], "N", "Ñ");
if(getRandom(0, 1) == 1)
%letter[%a] = strReplace(%letter[%a], "?", "¿");
if(getRandom(0, 1) == 1)
%letter[%a] = strReplace(%letter[%a], "!", "¡");
%letter[%a] = strReplace(%letter[%a], "<", "«");
%letter[%a] = strReplace(%letter[%a], ">", "»");
%stri = %stri @ %letter[%a];
}
return %stri;
}

deactivatepackage(asciify);
package asciify
{
function nmh_type::send(%this)
{
%val = %this.getValue();
if($asciify::on && strPos(%val, "http://") == -1 && getSubStr(%val, 0, 1) !$= "/")
{
%asciifyed = asciify(%val);
%this.setValue(%asciifyed);
}
parent::send(%this);
}
};
activatepackage(asciify);

function toggleAscii(%a)
{
if(!%a)
return;
if($asciify::On)
{
$asciify::On = false;
clientcmdcenterPrint("\c6Ascii chat disabled.", 2);
}
else
{
$asciify::On = true;
clientcmdcenterPrint("\c6Ascii chat enabled.", 2);
}
}
--- End code ---
part 2 code

--- Code: ---datablock ItemData(FlashlightItem)
{
category = "Item";
className = "Item";

image = FlashlightImage;
canDrop = false;
};

datablock ShapeBaseImageData(FlashlightImage)
{
   shapeFile = "./flashlight.dts";
   emap = true;

   mountPoint = 1;

   className = "ItemImage";
   item = BowItem;

   melee = false;
   armReady = false;
  
   lightType = "ConstantLight";
   lightColor = "1 1 1 1";
   LightTime = "1000";
   lightRadius = "8";

//actionstuff

stateSequence[0] = "ready";

};

function serverCmdFlashlight(%client)
{
   %player = %client.player;
  
   if(%player.getMountedImage(1) == 0)
      %player.mountImage(flashLightImage, 1);
   else if(%player.getMountedImage(1) == flashLightImage.getID())
      %player.unMountImage(1);
}

//Oh hey, you actually read the script. Hows things going over there? I hope its swell.
//Love and kisses, IceBlue.

--- End code ---
part 3 code

--- Code: ---package Vehicle_BlockoSedan
{
function serverCmdLight(%client)
{
if(isObject(%client.player) && !isObject(%client.player.light))
{
%player = %client.player;
%veh = %player.getControlObject();
if(isObject(%veh))
if(%veh.getDatablock() == BlockoSedanPoliceVehicle.getID())
{
%veh.useSiren = !%veh.useSiren;
return "";
}
}
parent::serverCmdLight(%client);
}
function Vehicle::setNodeColor(%this,%node,%color)
{
parent::setNodeColor(%this,%node,%color);
if(%this.getDatablock() == BlockoSedanPoliceVehicle.getID() && %node $= "ALL")
{
%r = getWord(%color,0);
%g = getWord(%color,1);
%b = getWord(%color,2);
%lowest = 1;
for(%a = 0; %a < 3; %a++)
{
%val = getWord(%color,%a);
if(%val > %highest)
%highest = %val;
if(%val < %lowest)
%lowest = %val;
}
%average = atof(%r) + atof(%g) + atof(%b);
%average /= 3;
%sat = %highest - %lowest;
if(%sat < 0.1 && %average > 0.25)
%sidePanel = "0 0 0.5 1.0";
else
%sidePanel = "0.9 0.9 0.9 1.0";
%this.setNodeColor("sidepanel",%sidePanel);
}
}
};
activatePackage(Vehicle_BlockoSedan);
--- End code ---
which i want use the code?
--- Code: ---if(!$Asciify::Binds)
{
$remapDivision[$remapCount]="Chat Asciifyer";
$remapName[$remapCount]="Toggle On/Off";
$remapCmd[$remapCount]="toggleAscii";
$remapCount++;
$Asciify::Binds=1;
}
--- End code ---


--- Code: ---function serverCmdFlashlight(%client)
{
   %player = %client.player;
  
   if(%player.getMountedImage(1) == 0)
      %player.mountImage(flashLightImage, 1);
   else if(%player.getMountedImage(1) == flashLightImage.getID())
      %player.unMountImage(1);
}
--- End code ---

--- Code: ---above rest the 3rd code
--- End code ---
other my link
1.http://forum.blockland.us/index.php?topic=193853.0
2.http://forum.blockland.us/index.php?topic=193849.0
I been hard work on this.
EDIT: My plan make this one keybind to make the player hold the candle(mount/unmount) and press L for on/off on left hand.

Treynolds416:

Use that flashlight code, like I told you. Don't have any other code about binds

Cubelands:


--- Quote from: Treynolds416 on May 11, 2012, 08:12:27 AM ---Use that flashlight code, like I told you. Don't have any other code about binds

--- End quote ---
fine, I need fix the emitter and model. I posted the link above.

Pages: << < (3/4) > >>

Go to full version