Jump to content
  • 0

help getcharid and isloggedin problem


PandaLovesHamster

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

It keeps saying I am not online. Please point out to me what is wrong with this script?  /hmm

			mes "[ GM Controller ]";
			mes "Input party leader name.";
			input .@ptlead$;
			set .@ptlead,getcharid(0,.@ptlead$);
			set .@ptparty,getcharid(1,.@ptlead$);
			if(!isloggedin(.@ptlead)){
				mes "This player is offline.";
				close;
				end;
			}
			next;
			mes "[ GM Controller ]";
			mes "Now warping...";
			close2;
			sleep2 3000;
			getmapxy(.Map$,.@x,.@y,0);
			warpparty .Map$,.@x,.@y,.@ptparty;
			end;
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   10
  • Joined:  01/15/16
  • Last Seen:  

Its because the command isloggedin ask for the account id, not the char id...

you have to change this line:

set .@ptlead,getcharid(0,.@ptlead$);

into this one:

set .@ptlead,getcharid(3,.@ptlead$);

An so on you will have the account id in the variable .@ptlead

 

 

EDIT

Ah, i just realized that if he have another pj on, it will say that its connected too, so you have to put this:


set .@ptleadAC,getcharid(3,.@ptlead$);//to obtain the account id
set .@ptleadCH,getcharid(0,.@ptlead$);//to obtain the character id

and in this line

if(!isloggedin(.@ptlead)){

change to:

if(!isloggedin(.@ptleadAC, .@ptleadCH)){

and you have it, it will check if the character of that account its connected.

Edited by Enthr
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

Thanks, I will test this as soon as I get back from class. I should have read isloggedin more and could have noticed that it asks for AID. Thanks for pointing that out.

Question:

getmapxy(.Map$,.@x,.@y,0);
warpparty .Map$,.@x,.@y,.@ptparty;

I was the one who coded this, but I'm not sure if that one works the right way I want it to. What I want is that the NPC gets the GM's coordinates and the warp the whole party/guild into that map. Will the work or am I lacking something?

Edited by PandaLovesHamster
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   10
  • Joined:  01/15/16
  • Last Seen:  

its correct

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...