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
  #16  
Old 09-23-2005, 10:15 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
That's what I thought, but someone was telling me that param[1] was for the account...

NPC Code:

function onPM("test",text){
if (text == "test"){
sendpm("Hey it worked *******");
}
}



Or am I overlooking something else?
__________________
torankusu's
Reply With Quote
  #17  
Old 09-24-2005, 03:45 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
That's what I thought, but someone was telling me that param[1] was for the account...

NPC Code:

function onPM("test",text){
if (text == "test"){
sendpm("Hey it worked *******");
}
}



Or am I overlooking something else?

Try:

PHP Code:
function onPM(somethingtext) {
  if (
text == "test") { 
    
sendpm("yay");
  }

Also make sure you have in the onCreated() section:
PHP Code:
setpm(NULL); 
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #18  
Old 09-24-2005, 08:18 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Why the hell does the first param have to be set to "something" ?
__________________
torankusu's
Reply With Quote
  #19  
Old 09-24-2005, 09:10 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
Why the hell does the first param have to be set to "something" ?
You can make it whatever you want. I don't know what it is, so i called it 'something'.

You can also just do.

PHP Code:
function onPM() {
  if (
params[1] == "test") {
    
sendpm("yay");
  }

(Keep in mind that params[1] is really the second parameter. Arrays start at 0.)
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
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 11:52 PM.


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