Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command getcharid:
 
* 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 character.

Type is the kind of associated ID number required:

0 - Character ID number.
1 - Party ID number.
2 - Guild ID number.
3 - Account ID number.

For most purposes other than printing it, a number is better to have than a name
(people do horrifying things to their character names).

If the character is not in a party or not in a guild, the function will return 0
if guild or party number is requested. If a name is specified and the character
is not found, 0 is returned.

If getcharid(0) returns a zero, the script got called not by a character and
doesn't have an attached RID. Note that this will cause the map server to
print "player not attached!" error messages, so it is preferred to use
"playerattached" to check for the character attached to the script.

Return Values:

- Type = 0: Character ID of the attached person or given character name
- Type = 1: Party ID of the attached person or given character name
- Type = 2: Guild ID of the attached person or given character name
- Type = 3: Account ID of the attached person or given character name
- When no player is attached or the specified character is offline: 0
- When the player is not in a party or guild and the type is 1 or 2: 0

Examples:

> if (getcharid(2)) mes "Only members of a guild are allowed beyond this point!";
self explanatory?

Valid XHTML 1.0 Strict Valid CSS!