I tried to jump into this on my own, figuring I got enough knowledge in to do really basic things. But absolutely none of the things I've tried to implement work.
Some of the code is already in the RP-Chat mod.
Keep in mind I'm very very new to doing this, so a lot of it might look odd. If anyone could help fix these issues and explain how to do so/why these fixes do what, that will be awesome.
function serverCmdwarn(%client, %target, %msg) //To warn players of their wrongdoing. Is the only command that worked. I planned to notify the person warning that their warn went through. (And I know how to do so.)
{
if (!%client.isAdmin)
return;
%target = findClientByName(%target);
messageClient(%target, '', "\c3[You have been warned by \c6" @ %client.name @ "\c3 for ''\c6" @ %msg @ "\c3''\c3]");
%timeswarned[%target] += 1;
}
function serverCmdtimeswarned(%client, %target, %timeswarned) //for admins to see how many times a player was warned.
{
if (!%client.isAdmin)
return;
%target = findClientByName(%target);
messageClient("\c3" @ %target @ "\c6 has been warned \c3" @ %timeswarned[%target] @ "\c6 times.");
}
function serverCmdclearwarns(%client, %target, %timeswarned) //to clear the warnings a player has
{
if (!%client.isAdmin)
return;
%target = findClientByName(%target);
%timeswarden[%target] = 0;
}
function serverCmdtoggleOOC(%client) //To turn off the OOC
{
if (!%client.isAdmin)
{
if (%oocmute = 1)
{
%oocmute = 0;
announce("\c6The \c3OOC \c6has been disabled!");
}
else if (%oocmute = 0)
{
%oocmute = 1;
announce("\c6The \c3OOC \c6has been enabled!");
}
}
return;
}
function serverCmdMute(%client, %target) //To mute players from using the OOC
{
if (!%client.isAdmin)
return;
%target = findClientByName(%target);
$isMuted[%target.bl_id] = true;
messageClient(%target, '', "\c6You have been OOC muted by \c3" @ %client.name);
echo(%client.name SPC "muted" SPC %target.name);
messageClient(%client, '', "\c6You muted \c3" @ %target.name);
}
function serverCmdTeamMessageSent(%this, %msg) //Using the mute and toggle commands
{
if (%oocmute = 1)
{
messageClient("\c3The OOC is disabled!");
}
else
{
if (!%isMuted[%target.bl_id] = true)
{
messageClient("\c3You are muted!");
}
else
{
serverCmdOOC(%this, %msg);
}
}
}
function serverCmdMessageSent(%this, %msg) //again using the mute&toggle commands
{
if(!%this.hasSpawnedOnce || !isObject(%this.player))
{
//If they haven't spawned, OOC.
if (%oocmute = 1)
{
messageClient("\c3The OOC is disabled!");
}
else
{
if (!%isMuted[%target.bl_id] = true)
{
messageClient("\c3You are muted!");
}
else
{
serverCmdOOC(%this, %msg);
}
}
return;
}
//code continues here but with it's original purposes
function ItemData::onPickup(%this, %obj, %user, %amount) //Trying to notify admins when people pickup items
{
Parent::onPickup(%this, %obj, %user, %amount);
serverCmdAdminChat(%user @ "picked up an item!");
}
function Weapon::onPickup(%this, %obj, %player, %amount)
{
Parent::onPickup(%this, %obj, %player, %amount);
serverCmdAdminChat(%user @ "picked up a weapon!");
}
Put it in quotes for the //