Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 19:36

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

Advertisement



i need just one code please any one help!

Discussion on i need just one code please any one help! within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2017
Posts: 55
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
 
JaniQ's Avatar
 
elite*gold: 0
Join Date: Apr 2014
Posts: 117
Received Thanks: 91
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: 55
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
 
Nyorai's Avatar
 
elite*gold: 200
Join Date: Sep 2011
Posts: 202
Received Thanks: 108
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: 55
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


Similar Threads 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 +1. The time now is 19:36.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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