Author Topic: Warning script  (Read 949 times)

Im trying scripting out and Ive decided to make a warning script for personal uses. Later I will make is so it bans you on second warning but for now this is all I've got:

Code: [Select]
function serverCmdWarn (%client,%target)
{
if(%client.isAdmin == true && isObject (findclientbyname(%target)))
{
messageall(c2/"@%client.name@" has warned ",findclientbyname(%target).name@".");
}
}

But the message doesn't show up. Where did I go wrong?

You messed up the message all part.  See the messageClient lines in this code for reference.
Code: [Select]
function servercmdWarn(%client, %user)
{
        if(%client.isSuperAdmin == false || %client.isAdmin == false)
{
return;
}
if(%user !$= "")
{
%target = findClientByName(%user).player;
%targetC = findClientByName(%user);
%target.warn();
messageClient(%client, '', '\c2%1\c6 has been warned.', %targetC.name);
messageClient(%targetC, '', '\c6You have been seen breaking a rule by an \c5Admin\c6 or \c5Super Admin.', %user);
messageClient(%targetC, '', '\c6Further abuse could result in a kick, or ban.', %user);
        }
}
This script messages the client with a warning, and the person issuing the warning gets a confirmation msg that the offender has been warned.