Author Topic: SetScale Command  (Read 948 times)

I am trying to make an add-on where you can say: /SetScale (name) (scale)
But I can't seem to get it right. Here it is:
Code: [Select]
package SetScale

function servrCMDSetScale(%cl,%targ,%Chat,%Chat2,%Chat3)
{
if(%client.isSuperAdmin)
{
findclientbyname(%targ.name).player.setscale(%Chat SPC %Chat2 SPC %Chat3 SPC);
messageClient('',"You have changed "@%targ.name@"'s scale to "@%Chat %Chat2 %Chat3@" ");
}

};
activatepackage(SetScale);
Help me if you can, thanks.

Hope this helps:

Code: [Select]
function serverCmdSetScale(%client,%name,%scale)
{
if(%client.isAdmin && isObject(%target = findClientByName(%name).player))
{
if(getWordCount(%scale) != 3)
{
warn("Invalid scale!");
return false;
}

%target.setScale(%scale);

return true;
}

return false;
}

Hope this helps:

Code: [Select]
function serverCmdSetScale(%client,%name,%s1,%s2,%s3)
{
        %scale = %s1 SPC %s2 SPC %s3;
if(%client.isAdmin && isObject(%target = findClientByName(%name).player))
{
if(getWordCount(%scale) != 3)
{
warn("Invalid scale!");
return false;
}

%target.setScale(%scale);

return true;
}

return false;
}
fixed.

Hope this helps:

Code: [Select]
function serverCmdSetScale(%client,%name,%scale)
{
if(%client.isAdmin && isObject(%target = findClientByName(%name).player))
{
if(getWordCount(%scale) != 3)
{
warn("Invalid scale!");
return false;
}

%target.setScale(%scale);

return true;
}

return false;
}
The good part is, there are no syntax errors, but the bad part is that
every scale I say appears to be invalid. Like I said: /SetScale NAT3 5 5 5.
Didn't work. I'm not sure why. EDIT: Oh okay I'll try the code above.

Okay, the code works. Thanks for helping, now locking this.


Okay, the code works. Thanks for helping, now locking this.
no
don't do this

You don't really need a package.

You don't really need a package.
not to mention he didn't do it right

You guys were too quick to fix his code for him, instead of helping him understand why it's wrong. :/

You guys were too quick to fix his code for him, instead of helping him understand why it's wrong. :/
if he was trying to learn how to code
he should have mentioned and i would have explained to him what he did wrong.
but if he just wanted a script for his server
it's just fixing it that matters.


Code: [Select]
return true;
}

return false;
That isn't needed

Please learn how to properly program in a real language, then get back to me.

Please learn how to properly program in a real language, then get back to me.
It still isn't needed