Need Help With My /power Command

This seems to be the only thing keeping me from releasing Betatron of phantom construction

I hope someone can identify a problem in this code

function ccpower(%sender,%args) {
%power=getwords(%args,0);
if(%power > 250 && !%sender.isadmin)
messageclient(%sender, 'MsgClient', "\c2your not admin so your power freq cannot exceed 250.");
else if(%power < 0)
messageclient(%sender, 'MsgClient', "\c2 ???...NOOB!!! There is no such thing as a Negative Frequency.");
else
%sender.powerFreq = %power;
messageclient(%sender, 'MsgClient', "\c2Power Frequency set to "@%power@&quot;.");
}

Thanks -Phantom

Comments

  • For starters, you aren't stopping the function if they get an invalid frequency in the first two, and your third isn't encapsulated, so it's just using the %sender.powerFreq (which should be %sender.player.powerFreq) directly under and would use the following messageclient no matter what.

    I also might direct you to this thread if you want to shorten it a bit:
    http://www.the-construct.net/forums/showthread.php?p=553
Sign In or Register to comment.