Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-14-2011, 08:48 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
NPC Help

Hello,

Can someone tell me how to change the default message of the NPC that somebody gets when they enter the game?
Also, can someone tell me how to give the NPC Server commands? For example when someone says "/staffapp" they will receive the staff application automatically.

Regards
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #2  
Old 05-14-2011, 08:57 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
There is no default message that players receive on login from the NPC-server. If you mean a PM, somebody must have added that to your server, it's probably in the Control-NPC script.

Use TServerPlayer.sendPM(str message) for sending players PMs. Serverside only.

Example:

PHP Code:
function onActionServerSide(temp.cmdtemp.chat) {
  if (
temp.cmd == "chat") {
    
player.sendPM("You said:\n" temp.chat);
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  
triggerServer("gui"this.name"chat"player.chat);

__________________
Reply With Quote
  #3  
Old 05-14-2011, 09:22 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
Quote:
Originally Posted by cbk1994 View Post
There is no default message that players receive on login from the NPC-server. If you mean a PM, somebody must have added that to your server, it's probably in the Control-NPC script.

Use TServerPlayer.sendPM(str message) for sending players PMs. Serverside only.
i put

PHP Code:
function onActionServerSide(temp.cmdtemp.chat) {
  if (
temp.cmd == "chat") {
    
player.sendPM("You said:\n" temp.chat);
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  
triggerServer("gui"this.name"chat"player.chat);

in npcscript and it didnt work when i tried saying chat...
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #4  
Old 05-14-2011, 09:30 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
Quote:
Originally Posted by mrnothersan View Post
Hello,

Can someone tell me how to change the default message of the NPC that somebody gets when they PM the NPC-Server?
Regards
it says

Quote:
I am the npcserver for
this game server. Almost
all npc actions are controlled
by me
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #5  
Old 05-14-2011, 10:16 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by mrnothersan View Post
it says
In the Control-NPC,

PHP Code:
function onCreated() {
  
this.setPM("");
}

function 
onInitialized() {
  
this.trigger("created");

For the chat thing, that will need to be in a weapon, not the Control-NPC.
__________________
Reply With Quote
  #6  
Old 05-14-2011, 10:30 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
Quote:
Originally Posted by cbk1994 View Post
In the Control-NPC,

PHP Code:
function onCreated() {
  
this.setPM("");
}

function 
onInitialized() {
  
this.trigger("created");

For the chat thing, that will need to be in a weapon, not the Control-NPC.

Error...
Script: Function setPM not found at line 2 in script of Control-NPC
__________________

Regards
MrNothersan - Playerworld owner


Staff Hirings Thread for MrNothersan: http://forums.graalonline.com/forums....php?p=1639180

Reply With Quote
  #7  
Old 05-14-2011, 10:41 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by mrnothersan View Post
Error...
Script: Function setPM not found at line 2 in script of Control-NPC
Try replacing this.setPM with setpm.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.