I don't see any real reason why you would want the 'player' object to draw it anyway. I would do something like this:
Weapon: -GUI
PHP Code:
//#CLIENTSIDE
function onCreated() {
player.gui = this;
}
public function showRect(id, x, y, width, height) {
showpoly(id, {x, y, x+width, y, x+width, y+height, x, y+height});
player.chat = "Nice rectangle!";
}
In other scripts you should be able to do:
PHP Code:
//#CLIENTSIDE
function onCreated() {
player.gui.showRect(200, 0, 0, 64 64);
}
Honestly though I would just make the function public in the GUI and call the GUI directly instead of using a player function. I.e:
(@"-GUI").showRect(...);