Author Topic: Local Chat (New problem)  (Read 800 times)

It now messes with the chat commands. (^)
Code: [Select]
package PitroRP_chat
{
function ServerCmdMessageSent(%client, %text)
{
if (isObject(PitroRPMini) && $PitroRP::pref::server::localChat && isObject(%client.player))
{
%heard = 0;
// Amount of players in the area
InitContainerRadiusSearch(%client.player.getPosition(), $PitroRP::pref::server::visibleDistance, $TypeMasks::PlayerObjectType);
while((%search = ContainerSearchNext()) != 0)
%heard++;

%color = %heard > 1 ? "\c2" : "\c0";

// Send the message
InitContainerRadiusSearch(%client.player.getPosition(), $PitroRP::pref::server::visibleDistance, $TypeMasks::PlayerObjectType);
while((%search = ContainerSearchNext()) != 0)
{
messageClient(%search.client, 'chatMessage', %color @ "\c5" @ %client.clanPrefix @ "\c3" @ %client.name @ "\c5" @ %client.clanSuffix @ "\c6: " @ %text);
%heard++;
}
}
else
{
Parent::ServerCmdMessageSent(%client, %text);
}
}
};
activatePackage(PitroRP_chat);
Would replaceing
Code: [Select]
if (isObject(PitroRPMini) && $PitroRP::pref::server::localChat && isObject(%client.player))with
Code: [Select]
if(getSubStr(%text, 1, 0) $= "^")Fix it?'


quci edit: Also, Mctwist gave me permission.
Maybe because you can't just rip out code and slam your name all over it and expect it to work.
I don't mind. It's free source.
And heed, Just leave. You have ruined almost every damn help thread i make.
« Last Edit: May 10, 2010, 10:57:28 PM by pitfall »

Don't just rip stuff out of scripts.
They're is a Local script .cs on the RTB Wiki, you'll have to look around, I cannot find it.

Don't just rip stuff out of scripts.
They're is a Local script .cs on the RTB Wiki, you'll have to look around, I cannot find it.
Ill rip stuff out of your teddy bear.

..............  but it dose not work for some reason.
What happens when you try to use it?

try putting some echo statements inside the code so you can see whats going on.

Maybe because you can't just rip out code and slam your name all over it and expect it to work.

if (isObject(RP_MiniGame) && $PitroRP::pref::server::localChat && isObject(%client.player))

just add
Code: [Select]
if(getSubStr(%text, 1, 0) $= "^"){
   Parent::ServerCmdMessageSent(%client, %text);
   return;
}
right after
Code: [Select]
function ServerCmdMessageSent(%client, %text)
{

and that should fix it.