Author Topic: How do I make a weapon so only admins can use it?  (Read 913 times)

Well, I need to make it so when you equip the weapon it checks if you are an admin, I tried
Code: [Select]
if(%client.isAdmin || %client.isSuperAdmin)
{
blahblahstuffhere
}
else
{
blahblahblah warning that you cant use it
};
it didn't work, could someone help me please?
« Last Edit: December 30, 2011, 11:52:45 AM by Lando The Climber »

Try
Code: [Select]
if(%client.isAdmin || (%client.isSuperAdmin))
{
//code here
}
else
{
//code here
} //do not put the ; unless it is the closing bracket of a package.

It doesn't load, I checked the error report in the console and it put the ## things around the % sign in %client.isAdmin


Code: [Select]
function WeaponImage::OnMount(%this, %obj)
{
%client = %obj.client;
    if(%client.isSuperAdmin || %client.isAdmin)
    {
    Parent::OnMount(%this, %obj);
    }
    else
    {
    %client.centerPrint('5', '<color:ff0000>This tool is for admins only.', '');
    }
}