View Single Post
  #9  
Old 06-30-2011, 11:27 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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(...);
__________________
Quote:
Reply With Quote