Jump to content
  • 0

How do I check if party exp share is set to even share?


Frosty

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  06/13/13
  • Last Seen:  

How do I check if party exp share is set to even share?

Thanks :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  06/13/13
  • Last Seen:  

Thanks

 

Edit: if anyone else is wondering how to check if party is in even share I added a script command that looks like this

BUILDIN_FUNC(getpartyshare)
{
	struct party_data *p;
	int i=0;

	p=party_search(script_getnum(st,2));


	if (p && p->party.exp)
		i++;
	mapreg_setreg(add_str("$@partyshare"),i);

	return 0;
}
Edited by Frosty
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

Can anyone update this ? Would be awesome.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

In the SQL table `party`, the `exp` column stores the Exp Share status.

I'm guessing 0 is off and 1 is on. You might want to double check that.

Remember that the value in SQL is not updated immediately when they change Exp Share in-game. I think it's autosaved every 300 seconds.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   1
  • Joined:  06/13/13
  • Last Seen:  

Yeh I figured that. Thanks though.

I was actually wondering if there was a script command to check if its on or do I have to make a custom one.

 

Edit: another question, if I make a custom script command in script.c do I need to declare it somewhere else so I can use it in scripts. Didnt seem to recognize my custom script command. (though I guess this should be asked in source support)

 

Edit2: eh I can just use query_sql right?

 

Edit3: cant figure out how to use it, no knowledge of sql stuff

 

    set .@partyid,getcharid(1);
    set .@share, query_sql(need help here)

 

I need it to get the value of exp from that exact partyid (.@partyid).

Edited by Frosty
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

There are 2 places in script.c you have to add your script command.

For example get_revision:

BUILDIN_FUNC(get_revision) {
	const char * revision;

	if ( (revision = get_svn_revision()) != 0 )
		script_pushint(st,atoi(revision));
	else
		script_pushint(st,-1);//unknown

	return 0;
}
	BUILDIN_DEF(get_revision,""),
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

how about this ?

BUILDIN_FUNC(getpartyshare)
{
	struct party_data *p;
	
	if( ( p = party_search( sd->status.party_id ) ) != NULL )
		script_pushint( st,p->party.exp );
		
	return 0;
}


BUILDIN_DEF(getpartyshare,""),

 

just a copy paste from above post ....

personally i try just show the value is enough...dont need to store it in a variable ...

if you want to store the value..just do like this..

.@exp_share = getpartyshare();
mes "EXP Share : "+( ( .@exp_share )? "ON":"OFF" );
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...