almost every server comes with it and its not hard to find...
|
Put this bit of code in your server process via client:
And declare:Code:if (StatTimer >= 0) StatTimer -= 1; if (StatTimer <= 0) { for (int i1 = 0; i1 < playerLevel.length; i1++) { if (playerLevel[i1] < getLevelForXP(playerXP[i1])) { playerLevel[i1] += 1; StatTimer = 90; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } else if (playerLevel[i1] > getLevelForXP(playerXP[i1])) { playerLevel[i1] -= 1; StatTimer = 90; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } } }
What this does is completely manage everyone's player stats, if a current stat is higher then the actual stat, it is lowered every 45 seconds until it is the same as the actual stat. Same procedure applies if a stat is lower then the actual stat level.Code:Public int StatTimer = 90;
Pretty much just delete all the timers associated with potions, because anyone who has ever tried to make potion timers just got put to shame.
~With love,
Wolf
almost every server comes with it and its not hard to find...
Are you sure this doesn't do what mine did?
Because i once attempted to do this, however when it called the method, it froze me for about 5 seconds whilst it looped through each stat checking it.
Change:
To this:Code:(StatTimer <= 0) { for (int i1 = 0; i1 < playerLevel.length; i1++) { if (playerLevel[i1] < getLevelForXP(playerXP[i1])) { playerLevel[i1] += 1; StatTimer = 90; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } else if (playerLevel[i1] > getLevelForXP(playerXP[i1])) { playerLevel[i1] -= 1; StatTimer = 90; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } }
Or else its gonna loop through every stat every half second if they are all at the correct level.Code:if (StatTimer <= 0) { for (int i1 = 0; i1 < playerLevel.length; i1++) { if (playerLevel[i1] < getLevelForXP(playerXP[i1])) { playerLevel[i1] += 1; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } else if (playerLevel[i1] > getLevelForXP(playerXP[i1])) { playerLevel[i1] -= 1; setSkillLevel(i1, playerLevel[i1], playerXP[i1]); NewHP = playerLevel[3]; refreshSkills(); } } StatTimer = 90; }
Find? You actually go 'looking' for code? what does that tell you.....ts not hard to find...
And palidino76, I want this to loop through every stat, that's how it's done in runescape, every stat is one level closer to the actual stat level. And do you not see the "StatTimer = 90;" at the end of a stat being returned closer to actual level? What you did has the exact same result as my original, you've done nothing more.
You misunderstood my post. Ok, say all your stats are at the correct level. If so, they niether increase nor decrease, and because of this with what you did the timer isn't delayed back to 45 seconds before checking again, but instead is delayed to every half second until one of your stats aren't at the correct level, which can cause a fair bit of lag. By putting the delay at the end it ensures that it waits 45 seconds whether or not it lowered/increased any stats to begin with.
I figured you'd try everything under the sun to try and slander my work. But, I also anticipated you pathetically despite attempt to demote anything I write, so with that said let me once again prove how little you know.
First off, making the loop ignore player prayer obviously isn't a hard task to do, a brain-dead kid like you could even do it.
Secondly, "Lag"? As Rat Dawg and I have already told you people, multi looped methods via server process has nothing to do with lag, time between packets sent is what gives you your 'lag'.
And to seal your sad post for good, "90/3 = 30 secounds ish", is this a joke? let's see, rs2 server's running speeds are default set to 500, which is, obviously 500ms(half a second), so how would 90ms = 30 seconds? You tell me Einstein...., you're obviously the math wiz here.
/\
|
|
Ownt Like hell.
Wolf, I used this and it works.
Also Rep++.
Thanks - RunePimp.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |