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 12-28-2011, 06:00 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
sendpm() parameters?

How could I send a players account within the sendpm(), like sendpm("hello", player.account)? Is there anything like setpmparams()?
__________________
MEEP!
Reply With Quote
  #2  
Old 12-28-2011, 06:13 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
PHP Code:
sendPM("Hello, " player.account "!"); 
Might be easier to use format but same concept. You're just telling it the message to send.
__________________
Reply With Quote
  #3  
Old 12-28-2011, 06:34 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
I know of that but what I wanted was something like I type something in a gui, the text will be sent serverside and than to the player who is supposed to get the PM (like findplayer(params[1]).sendpm(params[2]) for example).
When the player getīs the PM it will open a GUI with the text in it (custom window, not the default by Graal). Yet when a PM getīs sent with the default system I can check who has sent the PM.
PHP Code:
function onPM(other) {
  
player.chat other;

With the sendpm() itīs sent by the server which means my player will always say (npcserver). So I wanted to add a parameter which will send the players account of the player which sent the text.
__________________
MEEP!
Reply With Quote
  #4  
Old 12-28-2011, 06:47 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
You can't send PMs from any player other than the NPC-server. It sounds like what you're doing can be done with the PM GUI controls (GuiPMCtrl, GuiPMEditCtrl), though.
__________________
Reply With Quote
  #5  
Old 12-28-2011, 06:49 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Any other solution I could use?
__________________
MEEP!
Reply With Quote
  #6  
Old 12-28-2011, 06:57 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Maybe having a class joined to the player like:
PHP Code:
public function RecievePM(textother) {
  
triggerclient("gui""-System/PM""RecievedPM"textother); //need to add those stuff than in the PM weapon

and using like
PHP Code:
findplayer(params[1]).RecievePM(params[2], player.account
Would that be a good way?
__________________
MEEP!
Reply With Quote
  #7  
Old 12-28-2011, 07:07 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
What are you trying to achieve? If you just want to send messages you can do this easily using triggers. If you're trying to use the PM system, then there's no other way.
__________________
Reply With Quote
  #8  
Old 12-28-2011, 07:18 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Basicly I want to try getting a similar PM system like on the iServers. So far itīs working fine, when Iīm sending PMs with the normal system (f7) I can get the text and stuff. But I also want to add (like on the iServers) such a message button to a custom profile system so I can PM a player by clicking on him and messaging him (without using the f7/custom system)
__________________
MEEP!
Reply With Quote
  #9  
Old 12-29-2011, 10:15 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Can the send pm function send messages from other players? or only the npcserver?
Reply With Quote
  #10  
Old 12-29-2011, 10:29 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by callimuc View Post
Basicly I want to try getting a similar PM system like on the iServers. So far itīs working fine, when Iīm sending PMs with the normal system (f7) I can get the text and stuff. But I also want to add (like on the iServers) such a message button to a custom profile system so I can PM a player by clicking on him and messaging him (without using the f7/custom system)
The PM system on the iPhone servers is actually completely scripted, written using a combination of triggerserver/triggerclient and sendtext/receivetext. It does not use the built-in PM system.
Quote:
Originally Posted by scriptless
Can the send pm function send messages from other players? or only the npcserver?
Not in the same way that sendpm works serverside, no. You can do it by using a GUI PM control, but you cannot set or read the text contained in that control by script; the user must enter it on-screen. (I am not sure if the GUI PM control is limited to only privileged scripts.)
__________________
Skyld
Reply With Quote
  #11  
Old 12-30-2011, 01:46 AM
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 Skyld View Post
(I am not sure if the GUI PM control is limited to only privileged scripts.)
I don't think so--didn't UN have a scripted playerlist a while back with custom PM windows?
__________________
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:42 PM.


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