Jump to content
  • 0

set Variable is conf


XeroBall

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  12/18/11
  • Last Seen:  

users += 2*server.users;

 

if set Variable 2

 

users += Multiplier*server.users;

 

 

 

 

and Multiplier is setting in conf/battle/client.conf

 

how do?

 

 

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

src\map\battle.h

inside

 

extern struct Battle_Config
{
.....

    int item_restricted_consumption_type;
    int max_walk_path;
    int item_enabled_npc;
    int multiplier; // add this
    } battle_config;

src\map\battle.c

inside

static const struct _battle_data {
...
 
    { "item_restricted_consumption_type",   &battle_config.item_restricted_consumption_type,1,      0,      1,              },
    { "max_walk_path",                      &battle_config.max_walk_path,                   17,     1,      MAX_WALKPATH,   },
    { "item_enabled_npc",                   &battle_config.item_enabled_npc,                1,      0,      1,              },
    { "multiplier",                         &battle_config.multiplier,                      0,      0,      INT_MAX,        },
};

 

and you can call it using battle_config.multiplier

Edited by Cydh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  12/18/11
  • Last Seen:  

I'm compile it's error

char.c: In function ‘count_users’:
char.c:1817: error: ‘multiply’ undeclared (first use in this function)
char.c:1817: error: (Each undeclared identifier is reported only once
char.c:1817: error: for each function it appears in.)


 

int count_users(void)
{
 int i, users;

 users = 0;
 for(i = 0; i < ARRAYLENGTH(server); i++) {
  if (server.fd > 0) {
   users += multiply*server.users;
  }
 }
 return users;
}

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

You didn't say if it's used on char.c, because you said "conf/battle/client.conf" >_>

btw, how can you use 'multiply' without declaration? --a

and, what do you want for that script?

 

 

I think, the regulation is, char-server (some src\char files) reads conf/char_athena.conf

so

Index: char.c
===================================================================
--- char.c    (revision 17203)
+++ char.c    (working copy)
@@ -111,6 +111,8 @@
 int log_char = 1;    // loggin char or not [devil]
 int log_inter = 1;    // loggin inter or not [devil]
 
+short multiplier;
+
 // Advanced subnet check [LuzZza]
 struct s_subnet {
     uint32 mask;
@@ -5032,7 +5034,11 @@
             char_movetoused = config_switch(w2);
         } else if (strcmpi(w1, "char_moves_unlimited") == 0) {
             char_moves_unlimited = config_switch(w2);
-        } else if (strcmpi(w1, "import") == 0) {
+        } 
+        else if (strcmpi(w1, "multiplier") == 0) {
+            multiplier = config_switch(w2);
+        }
+        else if (strcmpi(w1, "import") == 0) {
             char_config_read(w2);
         }
     }

Edited by Cydh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  12/18/11
  • Last Seen:  

char_athena.conf can reload?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

can't

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  12/18/11
  • Last Seen:  

help me plz! if i'm set multiplier in char_athena = 2.3

 

but all people 4 = 4*2.3 = 9.2 = 9

 

but in server = 8

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  12/18/11
  • Last Seen:  

bumb

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  331
  • Reputation:   63
  • Joined:  11/29/11
  • Last Seen:  

help me plz! if i'm set multiplier in char_athena = 2.3

 

but all people 4 = 4*2.3 = 9.2 = 9

 

but in server = 8

You cannot set the multiplier in decimal, only integers, i.e 1,2,3,4,5,6

so as per you set

it reads only 2 and gives 4*2 = 8

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