Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-09-2007, 01:13 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
Question about PMs with NPC server

I'm trying to insert a command that a player can PM to the NPC server but I have no clue how. I'm assuming I have to put the script into the Control-NPC but I don't know what to put in there.

Joey told me

function onPM(text)
{
}

but he is unsure.
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
  #2  
Old 06-09-2007, 01:15 AM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
hmm
I think it is something like
PHP Code:
function onPM() {
  if (
params[0] == "test") {
    
sendpm("Test Message");
  }

Not sure tho..
I think params[0] is what you pm the player
__________________
Reply With Quote
  #3  
Old 06-09-2007, 01:19 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
nope, didn't work :[

I just got that "I am the npc server and all actions are controlled by me" or whatever.
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
  #4  
Old 06-09-2007, 01:22 AM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
have you tried to see if onRC() returns any parameters?

PHP Code:
function onRC()
  echo(
params); 
__________________
Reply With Quote
  #5  
Old 06-09-2007, 01:24 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
it doesn't :x
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
  #6  
Old 06-09-2007, 02:07 AM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
function onPM() {
  if (
params[1] == "testmsg") {
    
sendpm("woot, you got a message back!");
  }

just have setpm(NULL); in the onCreated() part of Control-NPC,
then it should work

params[0] is something
params[1] is the text being sent to the npcserver

also, try this when you have setpm(NULL);
PHP Code:
function onRC()
  echo(
params); 
__________________
Reply With Quote
  #7  
Old 06-09-2007, 02:40 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Sum41Freeeeek View Post
nope, didn't work :[

I just got that "I am the npc server and all actions are controlled by me" or whatever.
Under the onCreated() event, Put this:

PHP Code:
setPm(null); 
__________________
What signature? I see no signature?
Reply With Quote
  #8  
Old 06-09-2007, 02:46 AM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by godofwarares View Post
Under the onCreated() event, Put this:

PHP Code:
setPm(null); 
:-)
__________________
Reply With Quote
  #9  
Old 06-09-2007, 01:58 PM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
I don't really understand, can you explain further to what setPM(null); does? :x

does that just allow the NPC server to receive PMs and do further things with it? not to sure.
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!

Last edited by Sum41Freeeeek; 06-09-2007 at 02:11 PM..
Reply With Quote
  #10  
Old 06-09-2007, 02:42 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by Sum41Freeeeek View Post
I don't really understand, can you explain further to what setPM(null); does? :x

does that just allow the NPC server to receive PMs and do further things with it? not to sure.
It just disables the default automatic answering of PMs. You can also do setPM("This is an automatic message");, that will replace the automatic reply message. The onPM-event is only invoked if the default automatic message is empty.
Reply With Quote
  #11  
Old 06-09-2007, 03:43 PM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
got it, thanks!
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:21 AM.


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