Jump to content
  • 0

help getcharid and isloggedin problem


Question

Posted

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;

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...