Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   sendpm() parameters? (https://forums.graalonline.com/forums/showthread.php?t=134265435)

callimuc 12-28-2011 06:00 PM

sendpm() parameters?
 
How could I send a players account within the sendpm(), like sendpm("hello", player.account)? Is there anything like setpmparams()?

cbk1994 12-28-2011 06:13 PM

PHP Code:

sendPM("Hello, " player.account "!"); 

Might be easier to use format but same concept. You're just telling it the message to send.

callimuc 12-28-2011 06:34 PM

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.

cbk1994 12-28-2011 06:47 PM

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.

callimuc 12-28-2011 06:49 PM

Any other solution I could use?

callimuc 12-28-2011 06:57 PM

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?

cbk1994 12-28-2011 07:07 PM

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.

callimuc 12-28-2011 07:18 PM

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)

scriptless 12-29-2011 10:15 PM

Can the send pm function send messages from other players? or only the npcserver?

Skyld 12-29-2011 10:29 PM

Quote:

Originally Posted by callimuc (Post 1679746)
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.)

cbk1994 12-30-2011 01:46 AM

Quote:

Originally Posted by Skyld (Post 1679963)
(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?


All times are GMT +2. The time now is 04:09 PM.

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