Question With Chars

Discussion about Helbreath Server Files.
Post Reply
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

My 1st question is how to edit surces to player can have 0 exp and not conection lost when enter and 2nd how edit surces to make ehat player can have 99999999999999999999 exp and char will be work ??
HelbreatH Fuck The Future
romax
Member
Posts: 149
Joined: Sat Nov 01, 2003 10:42 am

Post by romax »

mikus wrote: My 1st question is how to edit surces to player can have 0 exp and not conection lost when enter and 2nd how edit surces to make ehat player can have 99999999999999999999 exp and char will be work ??
.... 1st use serch buttun.

2cnd... thet negative exp you cant fix it.
<img src='http://img357.imageshack.us/img357/505/eyecopy7ng.gif' border='0' alt='user posted image' />
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

yes i can fixt negative exp but is many chars to epeirs in one day ;/
HelbreatH Fuck The Future
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

mikus wrote: My 1st question is how to edit surces to player can have 0 exp and not conection lost when enter and 2nd how edit surces to make ehat player can have 99999999999999999999 exp and char will be work ??
2 : You have to change all the exp variables from int to __int64...

so it'll be coded on 64 bits and no more on 4 bits.
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

Diuuuude do you can give line of code where is that int ??
HelbreatH Fuck The Future
wannabee
Loyal fan
Posts: 270
Joined: Sun Dec 21, 2003 12:42 am

Post by wannabee »

__int64 has negative as well when you overload it...

gotta use 'unsigned __int64' ;P
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Human knowleag belongs to THE WORLD<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>So i highly dislike people who keep to their proud selfs... thats why i wanna share everything i got with you guys :D
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

mikus wrote: Diuuuude do you can give line of code where is that int ??
hum... i think there's at least 500 different places where you'll have to change var types so NO, i won't show every place where you have to change it...
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

To fix your negative exp bug place an if inside of the GetExp function. Just so I don't get spammed with questions i'll cover this 1 propperly.

A character's exp is stored in the data type int. Int has a range of –2,147,483,648 to 2,147,483,647. When a player's exp exceeds 2,147,483,647 it will rollover back to it's maximum negative value (–2,147,483,648) so the idea of this code is to not allow players to exceed 2,147,483,648 EXP.

Go into game.cpp and find CGame::GetExp (2.24b has 2 functions, 1 is commented. Use the one the compiler will read obviously)

Under

Code: Select all

if (m_pClientList[iClientH] == NULL) return;
Paste this

Code: Select all

if (m_pClientList[iClientH]->m_iExp > 2100000000) 
{
   m_pClientList[iClientH]->m_iExp = 2100000000;
   ShowClientMsg(iClientH, " You have reached maximum experience. You cannot level any further") 
   return;
}
I used 2100000000 just to make sure you noob servers with your 10000x exp don't bug anything and whine at me for 3 weeks straight for fucking your server. I'm pretty sure you can be maxed with 2100000000 exp. It also sets the exp back to 2100000000 so there's no luck of the draw as to who gets #1 on your top player script.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

Dax its not work i change it to if (m_pClientList[iClientH]->m_iExp > 99999900000000)
{
m_pClientList[iClientH]->m_iExp = 99999900000000;
ShowClientMsg(iClientH, " You have reached maximum experience. You cannot level any further")
return;
}

and i steal have exp on - in 214.............. lvl
plis help me
HelbreatH Fuck The Future
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

mikus wrote: Dax its not work i change it to if (m_pClientList[iClientH]->m_iExp > 99999900000000)
{
m_pClientList[iClientH]->m_iExp = 99999900000000;
ShowClientMsg(iClientH, " You have reached maximum experience. You cannot level any further")
return;
}

and i steal have exp on - in 214.............. lvl
plis help me
And the award of the BIGGEST 2K6 NOOB is for... Mikus !!!!

(Applause)


Ok, i'll say it for the last time, next time i take my gun and shoot atleast 150 bullets in your fuckin' empty head...


<span style='color:red'>EXP IS STORED IN AN INTEGER VARIABLE, SO IT CAN'T BE OVER 2,147,483,647 !!!!!!!!!!

CAN YOU UNDERSTAND WHAT 2,147,483,647 MEANS ??? IT MEANS THAT 2,147,483,648 = -2,147,483,648</span>.


As another exemple, the amount of damage you can make on another player / a NPC is stored in a SHORT variable (client side only, it's an INT on server). The client shows "critical" when you do more than ~125 dmg cuz dmg goes negative then... it's the same for exp but as the variable type used to store it is bigger (int), it goes negative later.


Did you understand that you CAN'T RUN a fuckin noob server with max level over 317 ??? Or if you want to do it so, <span style='color:red'>LEARN C++ FIRST !!!!!!!!!!!!!!!!!!!!!!!!</span>
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Post Reply