Jump to content
  • 0

Warp party check


Rizz

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  07/29/17
  • Last Seen:  

Hi guys, I tried to make an npc which can teleport a player as long as he is in a party. If player doesnt, they cant use the warper.
However, I always got an error which told me that I failed to put a curly in my script.

 

prontera,145,199,4	script	Struggler	10059,{
	if (getcharid(1) == 0){
		mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000";
		close;
	}
	else {
		mes .@npc$;
		mes "Would you like to enter the dungeon?";
		close2;
		warp "chalo2",70,114;
		end;
	}
}

I hope anyone can tell me where my mistake is. Thank you.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Your script will already check if the invoking player is in party or not 

if (getcharid(1) == 0){
   mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000";
   close;
}
*getcharid(<type>{,"<character name>"})

This function will return a unique ID number of the invoking character, or, if a
character name is specified, of that player.

Type is the kind of associated ID number required:

 0 - Character ID
 1 - Party ID
 2 - Guild ID
 3 - Account ID
 4 - Battle Ground ID
 5 - Clan ID

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

There's nothing wrong on your script.. your script might be included on another file.txt.. just create another file for it.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  07/29/17
  • Last Seen:  

Thanks for your help Haruka ?

May I ask one more question?

How to add partycheck in this script, since I always got an error (missing curlys) when I added one . For example

prontera,141,181,4	script	PvP Warper	10210,{

	.@npc$ = "["+strnpcinfo(0)+"]";
	if (getcharid(1) == 0){
	mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000";
	close;
	}
	mes .@npc$;
	mes "Would you like to enter the PvP Room?";
	next;
	switch(select("Enter Room [Current Users ~ "+getmapusers("pvp_n_1-1")+" ~]:Leave")) {	// Change pvp_y_2-2 into your PvP Map
	
		case 1:
			warp "pvp_n_1-1",0,0;	// Change pvp_y_2-2 into your PvP Map
			end;
			
		case 2:
			close;
	}
	end;
}

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  07/29/17
  • Last Seen:  

@Patskie , Thank you, but I still got an error which told me that I missed a curlys in my script. I tried to add and modifiy it but when I do so, the server only read the script till the line 6.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

Once again. i loaded the script code. nothing is wrong..

Is this a line from a script or is this the full script from a single file?..
I recommend that for every npc script. you create a new file because it's much organize and easier to locate the errors, it will also help as you will only load the single npc..

EDIT : Please include a screenshot of the error, this can help.

Edited by Haruka Mayumi
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  07/29/17
  • Last Seen:  

@Haruka Mayumi Wow, you are correct, it works. But I am confused because everytime I reload the script using @reloadnpc command the server said that I made an error or missing curlys, but if I try re-started the server, it worked normally. Anyway, thanks for both of you @Haruka Mayumi and @Patskie . 

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...