Author Topic: Coding Help - Everything is brokez.  (Read 10210 times)

A visual marker like a spawn brick is much cleaner IMO.

I agree with Wallet. I hate, for instance, how in the cashmod I need to go in f11 to see the deposit and withdraw triggers. A single jail spawn brick is efficient. Also, it can be repositioned so I can set (and see) where my bad-guys are going to go.

No idea where to start on the Go Directly to Jail card, though.


As requested.. my codez.


Code: [Select]
package jailspawn {
function fxDTSBrickData::onPlant(%this, %brick)
{
parent::OnPlant(%this, %brick);
if(isObject($jailbrick) && %brick.getdatablock().getname() $= "brickJailSpawnData") %brick.killbrick();
if(%brick.getdatablock().getname() $= "brickJailSpawnData") $jailbrick = %brick;
}
};


and.. I need to alter this to transofrm at the jail spawn..


Code: [Select]
%client.settransform(%client.telebrick.position);

As requested.. my codez.


Code: [Select]
//code wiped for failure to not call me a memespewing arsetard
give credit if used >.>
« Last Edit: September 12, 2007, 05:43:49 PM by rkynick »

I mutilated it to get it to run without crashing the server. After redoing the curley braces, I got it to run. However, it doesn't spawn where the person needs to be.


Code: [Select]
package jail {
function GameConnection::CreatePlayer(%this, %spawnpoint){
Parent::createPlayer(%this, %spawnpoint);
if(%this.intimeout){
%this.player.setTransform($Pref::Server::brickJailSpawnData);
}
}

function serverCmdsetjail(%client){
if(%client.issuperadmin){
  $Pref::Server::jailbrick=%client.player.getTransform();
}
}

function serverCmdGoToJail(%client,%victim){
if(%client.isSuperAdmin){
    for(%i = 0; %i < ClientGroup.getCount(); %i++){
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player) || %cl.bl_id $= %victim && isObject(%cl.player)){
      if(!%cl.intimeout){
        %cl.intimeout = 1;
        %cl.kill();
}
      }
else
{
        %cl.intimeout=0;
      }
}
}
}
};
activatepackage(jail);

I mutilated it to get it to run without crashing the server. After redoing the curley braces, I got it to run. However, it doesn't spawn where the person needs to be.


Code: [Select]
package jail {
//code wiped for failure to not call me a memespewing arsetard
};
activatepackage(jail);
« Last Edit: September 12, 2007, 05:43:09 PM by rkynick »

What do I send them to jail by? ID and Name both do not work.

If: it kills them off
 1. you must say /setjail, then where your standing becomes the jail.
If: it doesnt kill them
 1: you mustve borked something, or I did.


Code: [Select]
  $Pref::Server::jailbrick = new Trigger() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = "brickSpawnPointdata";
angelID = "0";
colorID = "16";
printID = "0";
colorFxID = "0";
shapeFxID = "0";
isBasePlate = "1";
isPlanted = "1";
stackBL_ID = "1649";
zombiedamage = "0";
client = %client;
            };

What's wrong with this? There is no brick plant.

Code: [Select]
  $Pref::Server::jailbrick = new FXdtsBrick() {
            position = %client.player.getTransform();
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = "brickSpawnPointdata";
angelID = "0";
colorID = "16";
printID = "0";
colorFxID = "0";
shapeFxID = "0";
isBasePlate = "1";
isPlanted = "1";
stackBL_ID = "1649";
zombiedamage = "0";
client = %client;
            };if($Pref::Server::jailbrick.plant()){$Pref::Server::jailbrick.delete();$Pref::Server::jailbrick = "";messageclient(%client,'',"\c3Brick cannot be planted.");}

What's wrong with this? There is no brick plant.
« Last Edit: September 12, 2007, 01:37:40 PM by Space Guy »

Works, thanks.

However, the setjail command does not work.

Code: [Select]
function serverCmdGoToJail(%client,%victim){
if(%client.isSuperAdmin){
messageAll(%client @ "\c6 has jailed \c0" @ %victim);
    for(%i = 0; %i < ClientGroup.getCount(); %i++){
      %cl = ClientGroup.getObject(%i);
      if(%cl.name $= %victim && isObject(%cl.player) || %cl.bl_id $= %victim && isObject(%cl.player)){
        if(!%cl.intimeout){
       %cl.intimeout = 1;
         %cl.kill();
}
      }
else
{
        %cl.intimeout=0;
      }
}

The message returns 'Iban has jailed '

That's not the setJail command...

If you want, I could just send you my Jail script, it works fine.

I changed it to gotojail. I meant to say that.

And no, I'm this close to finishing. I might aswell get this last script to work.