Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 PServer - Discussions / Questions
You last visited: Today at 01:30

  • Please register to post and access all features, it's quick, easy and FREE!


i need just one code please any one help!

Discussion on i need just one code please any one help! within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2017
Posts: 24
Received Thanks: 0
i need just one code please any one help!

C#
-
the effect of new level didn't appear when player get new lvl put the effect didn't missed , i found it appear when i lvl up supclass , i tried to make it but didn't work can any one help me !
-
Code:
 byte lvl = client.Entity.Level;
            int newlevel = client.Entity.Level + 1;
            if (client.Entity.Level >= 1)
                for (int i = newlevel; i < lvl; i++)
                {
                    client.Entity.Update(_String.Effect, "lighbo", true);
                    client.MessageBox("hi");
                }
that's for test only
Code:
 client.Entity.Update(_String.Effect, "lighbo", true);
                    client.MessageBox("hi");



empirewar is offline  
Old 06/04/2017, 02:42   #2
 
elite*gold: 0
Join Date: Apr 2014
Posts: 114
Received Thanks: 68
It's obviously because your loop doesn't execute.

You assign the value of the level in the variable lvl let's assume it's 1.
Now you assign the value of the newlevel in i which is the level +1 so 2.

Here
Code:
for (int i = newlevel; i < lvl; i++)
You check if i (2) is less than lvl(1) which is obviously false
thus the loop doesn't execute.

also the loop useless since two lines above you add only 1 which is not
a variable so the loop will always execute once.

I strongly recommend learning simple math before trying to code.


JaniQ is offline  
Old 06/04/2017, 02:47   #3
 
elite*gold: 0
Join Date: Apr 2017
Posts: 24
Received Thanks: 0
Quote:
Originally Posted by JaniQ View Post
It's obviously because your loop doesn't execute.

You assign the value of the level in the variable lvl let's assume it's 1.
Now you assign the value of the newlevel in i which is the level +1 so 2.

Here
Code:
for (int i = newlevel; i < lvl; i++)
You check if i (2) is less than lvl(1) which is obviously false
thus the loop doesn't execute.

also the loop useless since two lines above you add only 1 which is not
a variable so the loop will always execute once.

I strongly recommend learning simple math before trying to code.
:"D so what is the the right way of this code
empirewar is offline  
Old 06/04/2017, 05:43   #4
 
elite*gold: 200
Join Date: Sep 2011
Posts: 189
Received Thanks: 85
Quote:
Originally Posted by empirewar View Post
:"D so what is the the right way of this code
He literally just gave you the answer... Your loop will never be executed because the number on the left "newlevel" will never be higher than the one on the right "lvl"...
I mean, you say newlevel = lvl + 1, and then you write a loop thats supposed to be executed when lvl > newlevel... It's the other way around...

Let me make this easier for you:
A = 1;
B = A + 1;

You're basically telling it to run something when A > B ... Now ask yourself, if B = A + 1, when will A ever be > B?
This is 4th grade math..

And as JaniQ said, what's even the point of having a loop there when you add only 1? With the loop it would only be executed once so no point having the loop there


Nyorai is offline  
Old 06/04/2017, 07:01   #5
 
elite*gold: 0
Join Date: Apr 2017
Posts: 24
Received Thanks: 0
Quote:
Originally Posted by Nyorai View Post
He literally just gave you the answer... Your loop will never be executed because the number on the left "newlevel" will never be higher than the one on the right "lvl"...
I mean, you say newlevel = lvl + 1, and then you write a loop thats supposed to be executed when lvl > newlevel... It's the other way around...

Let me make this easier for you:
A = 1;
B = A + 1;

You're basically telling it to run something when A > B ... Now ask yourself, if B = A + 1, when will A ever be > B?
This is 4th grade math..

And as JaniQ said, what's even the point of having a loop there when you add only 1? With the loop it would only be executed once so no point having the loop there
Solved thanks :"D


empirewar is offline  
Reply



« Finding different versions of CO Clients. | How could I make DB double Event »

Similar Threads
PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE
06/21/2011 - Metin2 Private Server - 5 Replies
HELP WITH THIS PLEASE ON MY DEDICATED SERVER :-( http://www.youtube.com/watch?v=UyKOTLb960Q log_file_delete_old: stat: No such file or directory connect: Connection refused Timed out Connection refused
Guys please please please please make a euroshaiya bypass please game hack error
09/19/2009 - Shaiya - 5 Replies
Guys make a euroshaiya bypass please



All times are GMT +2. The time now is 01:30.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2019 elitepvpers All Rights Reserved.