Author Topic: Raycast's  (Read 2294 times)

Code: [Select]
package Package
{
   function GameConnection::OnPlayerEnterGame(%client)
   {
      %client.clanPrefix = "[Local]" @ %client.OldTag;
      parent::OnPlayerEnterGame(%client);
   }
   function GameConnection::AutoAdminCheck(%client)
   {
      %client.oldTag = %client.clanPrefix;
      parent::AutoAdminCheck(%client);   
      %client.clanPrefix = "[Loading]" @ %client.clanPrefix;
   }
   function GameConnection::OnDeath(%this, %player, %killer, %damageType, %unknownA)
   {
       Parent::OnDeath(%this, %player, %killer, %damageType, %unknownA);
      %this.clanPrefix = "[Dead]" @ %this.oldTag;
   }
};
Activatepackage(Package);

Sorry, edited.
Why doesn't ANYONE preserve the original clan tags?
It's so stupid and line-wasting the way people accomplish clan-tag editing
Code: [Select]
package Package
{
    function serverCmdTeamMessageSent(%client, %text)
    {
%clanPrefix = %client.clanPrefix;

if(!%client.hasSpawnedOnce)
    %client.clanPrefix = "[Loading]"@ %client.clanPrefix;

else if(!isObject(%client.player))
    %client.clanPrefix = "[Dead]"@ %client.clanPrefix;

else
    %client.clanPrefix = "[Local]"@ %client.clanPrefix;

//regular code here

%client.clanPrefix = %clanPrefix;
    }
};

haha i make trashy scripts. All those useless lines :D

I don't think you understand, I fixed it. That part of the code is working fine, Inless you find another bug with the current code. As of right now I only need help with the "/me" command.

First, I'm giving you away to switch it up. You cant send a perfectly complete message with a servercmd
There are some options here:
-Use what i just said and use servercmdMessageSent for the /me command.
-Add the clan tags and the /me command in the same servercmdMessageSent function.

First, I'm giving you away to switch it up. You cant send a perfectly complete message with a servercmd
There are some options here:
-Use what i just said and use servercmdMessageSent for the /me command.
-Add the clan tags and the /me command in the same servercmdMessageSent function.
Yes, you can. I've done it, if you would have read my other post you would have known this. You have to specify each argument if you want to do it, I was looking for a more efficient way to do so.

You cannot send a message with using _ as spaces. Every word you do is a different variable. It is more efficient to use servercmdMessageSent. You would have to create so many unneeded variables to do /me or you can use just use MessageSent with only 2 vars.
« Last Edit: December 12, 2009, 05:46:26 PM by Plornt »

You cannot send a message with using _ as spaces. Every word you do is a different variable. It is more efficient to use servercmdMessageSent. You would have to create so many unneeded variables to do /me or you can use just use MessageSent with only 2 vars.
Perhaps, I'll do some experiments and see what I can come up with. The code you originally posted doesn't seem to work.

Code: [Select]
package PACKAGE
{
function servercmdMessageSent(%client,%msg)
{
if(getSubStr(%msg,0,1) $= "*" && $RolePlayChat == 1)
{
%Message = getSubStr(%msg,1,strLen(%msg));
initContainerRadiusSearch(%client.player.position,20,$TypeMasks::PlayerObjectType);
while((%targetobject=containerSearchNext()) !$= 0)
{
%client=%targetobject.client;
messageClient(%client,'',"\c6" @ %client.Name @ " " @ %message);
}
echo("" @ %client.Name @ " - [Me] " @ %message @ "!");
return;
}
parent::serverCmdMessageSent(%client,%msg);
}
   function GameConnection::OnPlayerEnterGame(%client)
   {
      %client.clanPrefix = "[Local]" @ %client.OldTag;
      parent::OnPlayerEnterGame(%client);
   }
   function GameConnection::AutoAdminCheck(%client)
   {
      %client.oldTag = %client.clanPrefix;
      parent::AutoAdminCheck(%client);   
      %client.clanPrefix = "[Loading]" @ %client.clanPrefix;
   }
   function GameConnection::OnDeath(%this, %player, %killer, %damageType, %unknownA)
   {
       Parent::OnDeath(%this, %player, %killer, %damageType, %unknownA);
      %this.clanPrefix = "[Dead]" @ %this.oldTag;
   }
};
ActivatePackage(Package);

Ok, thanks to everyone that posted in this topic. I've finally finished the code with...successful results.

FYI. The second arguement for initContainerRadiusSearch is the container size. I'm pretty sure having just 20 will search in a 20 by 0 by 0 at the player's position.

FYI. The second arguement for initContainerRadiusSearch is the container size. I'm pretty sure having just 20 will search in a 20 by 0 by 0 at the player's position.
Define: Radius
The length of a line segment between the center and circumference of a circle or sphere

Define: Radius
The length of a line segment between the center and circumference of a circle or sphere
Hah, I always thought it was an arguement telling the size of the container to search in. But I just looked it up in the console reference, and it says floating point number. I think both ways work.

Hah, I always thought it was an arguement telling the size of the container to search in. But I just looked it up in the console reference, and it says floating point number. I think both ways work.
Not sure, I've never really taken a good look at the function. Either way though, it still works.  :cookieMonster: