Quote:
Originally Posted by Rapidwolve
On the Control-NPC under onActionPlayerOnline(), I added a line 'player.join("player");' In the class 'player' I made a public function we'll call it sayChat(message). In another player weapon I have player.sayChat("test"), but all I get is an error the F2 window saying function rapidwolve.sayChat() not found... blah blah...I searched forums on this and nothing worked. I know this can be done as I have seen it done before. Can anybody help?
|
There's no reason it shouldn't work. I have something like this in my Control-NPC ... player.join( "player-functions" );
I admit I've never done anything on it clientside, but I don't see why it shouldn't work. I'll post some examples for you to look at ...
in control NPC
PHP Code:
function onActionPlayerOnline()
{
player.join( "player" );
}
in the class 'player'
PHP Code:
//#CLIENTSIDE
public function setChat( setchat )
{
player.chat = setchat;
}
in some script
PHP Code:
//#CLIENTSIDE
function onCreated()
{
player.setChat( "blah" );
}
[Edit: If this doesn't work, maybe you could try joining clientside in a system NPC?]