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

here are your parameters for messageSent:

Code: [Select]
serverCmdMessageSent(%client, %message);Whar %message is a string that is the message.

Has been tested in the past (by me), I'm certain it works.

I was told that MessageSent used something like

%Client, %m1, %m2, %m3......

Oh well. I'll try that as soon as I get home.

Anyone have any idea why I'm still getting this error on each fire?

Quote
base/server/scripts/allGameScripts.cs (7809): Unable to find object: '' attempting to call function 'getEyeTransform'
base/server/scripts/allGameScripts.cs (7811): Unable to find object: '' attempting to call function 'getMuzzleVector'
base/server/scripts/allGameScripts.cs (7825): Unable to find object: '' attempting to call function 'getVelocity'
Projectile::Addon: mSourceObjectID is invalid

I know my method works, because I've used it in the console before. Besides, the thing that comes up when you press the "T" key outputs it's information into a single string. The only thing I'm not sure about is the name of the %message variable.

The only thing I'm not sure about is the name of the %message variable.
Woulden't that be the most important thing to know?

The only thing I'm not sure about is the name of the %message variable.
Wouldn't that be the most important thing to know?

Lol, yeah, probably. XD

But remember: I don't know this game's source code, lol.

If you used %message and it worked it should be fine. Is that the var you used?

Technically, I have only used it in the console to "impersonate" people, I have never used it within code/packaged it.

All I know is that it is at least 2 variable code, starting with %client, and then the message variable.

You don't need the names of the parameters to be the same when using packages, you can call them anything, but the first will always be the client id and the second; the message.

So I could make the function

function ServerCmdMessageSent(%Client, %lolpie){}

and it would work?

Alright! Thanks a bill Kirbz. The chat restriction code is fully functioning now.

All that remains is to get the fire code to end.

This is what I have so far:

Code: [Select]
package fireprevent{
function WeaponImage::onFire(%this,%obj,%slot)
{
if($restriction == 1;) // Off
{
messageClient(%client,"","\c6Your Weapon Fire has been restricted.");
return;
}
else
{
parent::onFire(%this,%obj,%slot);
}
}
};
activatepackage(fireprevent);


and I get an error each time I fire. Do note that the weapon is firing (The Tools move, brick weapons fire, and guns shoot, but there is no effect. E.g, no bullet, no brick, no collision particles.) My 'educated' guess would be that onfire is DURING the fire, and not BEFORE it.

Once again, here's my error:

Quote
base/server/scripts/allGameScripts.cs (7809): Unable to find object: '' attempting to call function 'getEyeTransform'
base/server/scripts/allGameScripts.cs (7811): Unable to find object: '' attempting to call function 'getMuzzleVector'
base/server/scripts/allGameScripts.cs (7825): Unable to find object: '' attempting to call function 'getVelocity'
Projectile::Addon: mSourceObjectID is invalid

I actually got it to work, however.. there is a dilemma.

The restriction var I'm using is an extension off of %client. Since %client isn't prompted normally, the restriction cant be tested. How do I resolve this?

EDIT: Thanks Mr.Wallet :D
« Last Edit: September 10, 2007, 12:14:29 AM by IbanX »

Code: [Select]
datablock fxDTSBrickData(brickJailSpawnData){
BrickFile = "IbanMod/jailspawnpoint.blb";
Category = "Special";
SubCategory = "Interactive";
UIName = "Jail Spawn";
IconName = "base/client/ui/brickIcons/Spawn Point";
};

package jailspawn{
function fxDTSBrickData::onPlant(%this, %brick)
{

if(isObject($jailbrick) && %brick.getdatablock().getname() $= "brickJailSpawnData") return;
parent::OnPlant(%this, %brick);
if(%brick.getdatablock().getname() $= "brickJailSpawnData") $jailbrick = %brick;
}
};
activatepackage(jailspawn);


The logic here is to only be allowed to plant one jailspawn. Any idea why this isn't working?

servercmdmessagesent(%clientSendingTheMessage, %textBeingSent)

Gee, thanks Wallet for allowing everyone on your server to be a richard to me. I appreciate the ban, too. Now I need to find someone with less sand shoved up their starfish to help me out.

You're over complicating things, just set a global variable to the players position.