View Single Post
  #1  
Old 05-19-2015, 08:41 PM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Referencing Weapons Clientside

So I know from experience that referencing weapons clientside can be done in multiple ways, the easiest two probably being the following.

Method 1:
Weapon NPC Foo
PHP Code:
//#CLIENTSIDE
function onCreated() {
  ( @ 
"Bar" ).foobar();

Weapon NPC Bar
PHP Code:
//#CLIENTSIDE
public function foobar() {
  
// code

Method 2:
Weapon NPC Foo
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
findWeapon"Bar" ).foobar();

Weapon NPC Bar
PHP Code:
//#CLIENTSIDE
public function foobar() {
  
// code

Which way is the "correct" way of referencing another object clientside? What are the differences between the two, if any? In the past I have always used method 1, but now I find myself most certainly wanting to use method 2 as it is an actual command loading an object (findweapon/findweaponnpc) rather than simply listing another weapon name. Might there be more functionality advantages to method 2 versus method 1 or vice versa that I might be missing?

Last edited by devilsknite1; 05-19-2015 at 11:20 PM..
Reply With Quote