Quote:
Originally Posted by Chandler
Having a bit of a problem. I'm having problems joining a class to a player when the log online.
Here's what I have so far, it just doesn't seem to interact with the player, at all.
HTML Code:
//#CLIENTSIDE
function onCreated()
{
player.join("player_weapon");
player.doAction({"drawMaps", "defaultStats"});
}
Inside the " player_weapon"
HTML Code:
//#CLIENTSIDE
function onCreated()
echo("GOT THE MAIN CONTROL!");
public function doAction(actionNames)
for (temp.currentAction: temp.actionNames)
this.(@ temp.currentAction)();
Neither are being called... suggestions? thanks!
|
well, for the onCreated in the class, essentially you are creating player.onCreated(), so that just isnt going to be called.
as for the doAction, you are calling player.drawMaps() and player.defaultStats(), since you are joining the class to the player, the player now becomes the object, so "this" will refer to the player. Since the player does not have those functions, they are not being called. In this case, it shouldn't have been joined to the player in the first place.
Joining a class to a player clientside sure does work
