Jump to content
  • 0

strcharinfo question


Question

Posted

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?
 

9 answers to this question

Recommended Posts

  • 1
Posted
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";

 

  • 0
Posted (edited)

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
  • 0
Posted

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!

  • 0
Posted

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

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