Jump to content
  • 0

strcharinfo question


Meister

Question


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

Hi see spoiler

 

*strcharinfo(<type>{,<char_id>})

 
This function will return either the name, party name or guild name for the 
invoking character. Whatever it returns is determined by type.
 
 0 - Character's name.
 1 - The name of the party they're in if any.
 2 - The name of the guild they're in if any.
 3 - The name of the map the character is in.
 
If a character is not a member of any party or guild, an empty string will be 
returned when requesting that information.

 
If I use that script command,
 
e.g.
 
if(strcharinfo(3) == prontera) {
mes "you're already at prontera";
}
 
So basically, i used bindatcmd script and want to check if player is already in map. and if player is already in map. Player can't use the command.
 
will it work?
 
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Needs to be if(strcharinfo(3) == "prontera")

But yes will work

Link to comment
Share on other sites

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

if (strcharinfo(3) == "prontera")
	mes "you're already at prontera";
else if (strcharinfo(3) == "payon")
	mes "you're already at payon";
else if (strcharinfo(3) == "aldebaran" || strcharinfo(3) == "geffen" || strcharinfo(3) == "yuno")
	mes "you're already at aldebaran or geffen or yuno";

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

Needs to be if(strcharinfo(3) == "prontera")

But yes will work

 

Woooot! it worked. Thanks man!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

A little tip, if you are setting/checking string/char types, always enclose them into quotation marks. Numbers, you don't have to unless your variable type is char or string.

Edited by jezznar
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

A little tip, if you are setting/checking string/char types, always enclose them into quotation marks. Numbers, you don't have to unless your variable type is char or string.

 

Can you give me an example? Thanks!

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

A little tip, if you are setting/checking string/char types, always enclose them into quotation marks. Numbers, you don't have to unless your variable type is char or string.

Can you give me an example? Thanks!

A string variable is any word variable rather then an integer which is a number

Reference your /doc/script_command.txt under variables for more info

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Sorry to revive this, but can I use this comand for multiple maps?

I tried it like this, but didn't work.

if(strcharinfo(3) == "prontera,alberta")

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Do for loops.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Thanks Capuche!

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