Version two:
function onPlayerCommand( player, cmd, text )
{
if (cmd == "cp" ) {
if (text) {
Create_Poly(player, text)
}
}
}
local x1_ = 0, y1_ = 0, x2_ = 0, y2_ = 0, x3_ = 0, y3_ = 0, x4_ = 0, y4_ = 0;
function Create_Poly(player, size) {
x1_ = player.Pos.x, y1_ = player.Pos.y, x2_ = player.Pos.x, y2_ = player.Pos.y, x3_ = player.Pos.x, y3_ = player.Pos.y, x4_ = player.Pos.x, y4_ = player.Pos.y;
size = size.tointeger()
//North East
x1_ += size;
y1_ += size;
// Display the positions on the radar
CreateClientBlip(player, BLIP_NONE, Vector(x1_, y1_, -1));
//South East
x2_ += size;
y2_ -= size;
// Display the positions on the radar
CreateClientBlip(player, BLIP_NONE, Vector(x2_, y2_, -1));
// South West
x3_ -= size;
y3_ -= size;
// Display the positions on the radar
CreateClientBlip(player, BLIP_NONE, Vector(x3_, y3_, -1));
// North West
x4_ -= size;
y4_ += size;
// Display the positions on the radar
CreateClientBlip(player, BLIP_NONE, Vector(x4_, y4_, -1));
// Output the poly so it can be copied and pasted
print("InPoly(player.Pos.x, player.Pos.y, "+x1_+", "+y1_+", "+x2_+", "+y2_+", "+x3_+", "+y3_+", "+x4_+", "+y4_+"); " );
}