I didn't test it, but something like this should work.
PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
temp.radius = 3;
temp.phi = 0;
if (player.chat.starts("/putpoly"))
{
temp.tok = player.chat.tokenize();
temp.sides = temp.tok[1];
if(temp.sides > 2) {
temp.dt = 2*pi/temp.sides;
temp.vert = {player.x+temp.radius*cos(temp.phi),player.y+temp.radius*sin(temp.phi)};
for(temp.i = 1; temp.i < temp.sides; ++temp.i) {
temp.vert.add( player.x+temp.radius*cos(temp.phi + temp.i*temp.dt) );
temp.vert.add( player.y+temp.radius*sin(temp.phi + temp.i*temp.dt) );
}
showpoly(20,temp.vert);
}
}
}