AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Surf xp (https://forums.alliedmods.net/showthread.php?t=244179)

Snitch 07-14-2014 18:42

Surf xp
 
Solved

Flick3rR 07-15-2014 04:05

Re: Surf xp
 
Look, you have to define maxkevels which are 6. Then set a size tonthe constants with the define (so there won't be anny mismatches). Your while loop is not correct. You have to "while" it like this:
PHP Code:

while(gLvl[Atkr] < MAXLEVELS 1){
      if(
gExp[Atkr] > Levels[gLvl[Atkr]])
             
//Plyer leveled up
      
else break



HamletEagle 07-15-2014 06:12

Re: Surf xp
 
Quote:

Originally Posted by Flick3rR (Post 2167881)
Look, you have to define maxkevels which are 6. Then set a size tonthe constants with the define (so there won't be anny mismatches). Your while loop is not correct. You have to "while" it like this:
PHP Code:

while(gLvl[Atkr] < MAXLEVELS 1){
      if(
gExp[Atkr] > Levels[gLvl[Atkr]])
             
//Plyer leveled up
      
else break



Why hardcode it ? Use sizeof.....

Flick3rR 07-15-2014 09:02

Re: Surf xp
 
Well,because he is using more than one constants and they all have to be with the same size. I think he has to use enum and put all the data in one constant, or define one certain size for all constants (so there won't be size mismatches and other rank for other level, etc. I don't know how to express it right). And practiculary, he will use that defined size as a size of all constants. It's like a size marker. I don't know if I explained it right....

HamletEagle 07-15-2014 09:36

Re: Surf xp
 
If he want that plugin to be working, he need the same size for every constant, so there is no reason to hardcode it. Still, if define the max size and put more/less intems in a constant he won't be able to compile, and will ask here. Both ways will reach the same thing: a new topic here. An enum is not a must if you know how to count.

Snitch 07-15-2014 13:19

Re: Surf xp
 
I have no idea what you're talking ..

Please you can fix me the code?

xDoctor 07-16-2014 00:47

Re: Surf xp
 
Quote:

Originally Posted by Snitch (Post 2168180)
I have no idea what you're talking ..

Please you can fix me the code?


nvm you edited the code.


All times are GMT -4. The time now is 21:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.