Jump to content
  • 0

Adding new guild variable(s)?


Hijirikawa

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

How do I add another variable to the guild? And how do I make a script command for it? I Just want to access a guild variable via script command. For instance I wanna check the experience how do I do so?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

int guild_id = script_getnum(st, 2);
struct guild* g = guild_search(guild_id);
script_pushint(st, g->exp);

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

1 hour ago, sader1992 said:

int guild_id = script_getnum(st, 2);
struct guild* g = guild_search(guild_id);
script_pushint(st, g->exp);

 

What are the files that I can put them in?

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

src/map/script.cpp

BUILDIN_FUNC(getguildexp)
{
	int guild_id = script_getnum(st, 2);
	struct guild* g;
	if((g = guild_search(guild_id)) == NULL){
		ShowWarning("buildin_getguildexp: unknown guild id '%d'.\n", guild_id);
		return SCRIPT_CMD_FAILURE;
	}
	script_pushint(st, g->exp);
	return SCRIPT_CMD_SUCCESS;
}
BUILDIN_DEF(getguildexp,"i"),

you need to check out how to add a command script before edit

ofc after editing recompiling

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