Frosty Posted June 25, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 8 Reputation: 1 Joined: 06/13/13 Last Seen: June 11, 2019 Share Posted June 25, 2013 How do I check if party exp share is set to even share? Thanks Quote Link to comment Share on other sites More sharing options...
Frosty Posted June 26, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 8 Reputation: 1 Joined: 06/13/13 Last Seen: June 11, 2019 Author Share Posted June 26, 2013 (edited) 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 June 26, 2013 by Frosty 1 Quote Link to comment Share on other sites More sharing options...
0 WhiteEagle Posted December 1, 2021 Group: Members Topic Count: 79 Topics Per Day: 0.02 Content Count: 480 Reputation: 67 Joined: 08/28/12 Last Seen: 6 hours ago Share Posted December 1, 2021 Can anyone update this ? Would be awesome. Quote Link to comment Share on other sites More sharing options...
Brian Posted June 26, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted June 26, 2013 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. 1 Quote Link to comment Share on other sites More sharing options...
Frosty Posted June 26, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 8 Reputation: 1 Joined: 06/13/13 Last Seen: June 11, 2019 Author Share Posted June 26, 2013 (edited) 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 June 26, 2013 by Frosty Quote Link to comment Share on other sites More sharing options...
Brian Posted June 26, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted June 26, 2013 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,""), Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 27, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 5 hours ago Share Posted June 27, 2013 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" ); Quote Link to comment Share on other sites More sharing options...
Question
Frosty
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.