|
You last visited: Today at 23:13
Advertisement
[Code Snippet - PHP] Private Server - Experience/Level Displays
Discussion on [Code Snippet - PHP] Private Server - Experience/Level Displays within the WarRock forum part of the Shooter category.
11/12/2013, 15:29
|
#1
|
elite*gold: 30
Join Date: Jun 2011
Posts: 3,335
Received Thanks: 1,356
|
[Code Snippet - PHP] Private Server - Experience/Level Displays
|
|
|
11/12/2013, 15:32
|
#2
|
elite*gold: 0
Join Date: Nov 2012
Posts: 592
Received Thanks: 394
|
Or easy
Quote:
function getLevelforExp($exp)
{
$level = 1;
$exp += 1;
$levelarr = array(1,2250,6750,11250,16650,24750,32850,41625,50 400,59175,
67950,76725,94725,112725,130725,148725,166725,1892 25,211725,234225,
256725,279225,306225,333225,360225,387225,414225,4 41225,497475,553725,
609975,666225,722475,778725,857475,936225,1014975, 1093725,1172475,1251225,
1363725,1476225,1588725,1701225,1813725,1926225,20 38725,2207475,2376225,2544975,
2713725,2882475,3051225,3219975,3444975,3669975,38 94975,4119975,4344975,4569975,
4794975,5132475,5469975,5807475,6144975,6482475,68 19975,7157475,7494975,7944975,
8394975,8844975,9294975,9744975,10194975,10644975, 11094975,11657475,12219975,12782475,
13344975,13907475,14469975,15032475,15932475,17282 475,18632475,19982475,21332475,22682475,
24032475,25382475,26732475,28307475,29882475,31457 475,33032475,34607475,36182475,37757475,
2147483647
);
for($i = 1; $i < 101; $i++)
if($exp > $levelarr[$i]) $level = $i;
return $level +1 ;
}
|
|
|
|
11/12/2013, 17:00
|
#3
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
@InstantBlood Your code is simply inaccaptable.
@~iToXiiC Your code iterates from 1 to 100 even if $levelarr[$i] is equal or bigger than $exp -> Useless iterations (assuming the redundant statements aren't removed by optimization)
|
|
|
11/12/2013, 17:01
|
#4
|
elite*gold: 0
Join Date: Nov 2012
Posts: 592
Received Thanks: 394
|
Quote:
Originally Posted by Yazzn (:
@InstantBlood Your code is simply inaccaptable.
@~iToXiiC Your code iterates from 1 to 100 even if $levelarr[$i] is equal or bigger than $exp -> Useless iterations (assuming the redundant statements aren't removed by optimization)
|
Well its realy old like 1 year old i was learning PHP before ^^
|
|
|
11/12/2013, 17:58
|
#5
|
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
|
Holy f***ing ****.
|
|
|
11/12/2013, 18:08
|
#6
|
elite*gold: 30
Join Date: Jun 2011
Posts: 3,335
Received Thanks: 1,356
|
Quote:
Originally Posted by Yazzn (:
@InstantBlood Your code is simply inaccaptable.
@~iToXiiC Your code iterates from 1 to 100 even if $levelarr[$i] is equal or bigger than $exp -> Useless iterations (assuming the redundant statements aren't removed by optimization)
|
Ist ein alter Code der bei mir rumlag.
Natürlich hätte man es leichter machen können, aber wie sagt man so schön "Es führen 1000 Wege nach Rom".
|
|
|
11/12/2013, 21:33
|
#7
|
elite*gold: 1
Join Date: Apr 2010
Posts: 13,772
Received Thanks: 15,036
|
Kann auch meiner Meinung nach  rein
closed
|
|
|
 |
Similar Threads
|
[Small Code Snippet] Local Hosting for Private Server Development
06/25/2012 - CO2 PServer Guides & Releases - 2 Replies
Hey everyone.
So previously, I was coming up with a few ideas on how to create a dynamic environment for development to simplify network communications (for demonstrations in random locations and such). I came up with a No-IP solution for public connections, but I don't always want my server to be public... so here's a local host solution:
// If the server is running on the local machine for development, get the
// ip address that the machine would like to use:
#region Get Local...
|
[Code Snippet] Save / Load Lists
03/31/2012 - C/C++ - 18 Replies
Falls ihr vor der selben Problemstellung steht wie ich vor einiger Zeit ^^
Hier ist die Lösung :P
//Nur eine Beispiel Struktur die ich für ein Programm genutzt habe
typedef struct
{
char szItem ;
float fGewicht;
} sItem;
|
[Code Snippet] getFloatFromString [C++
02/15/2012 - C/C++ - 5 Replies
I wrote a small function for getting a float from a string.
I know that this function isn't perfect.
It isnt very hard to fix it ;)
I belive in you guys :P
using namespace std;
float getFloatFromString (char *szBuffer);
|
[Code Snippet]Facing Character to X , Y
10/27/2009 - Aion Hacks, Bots, Cheats & Exploits - 4 Replies
Hey community,
i want to share some code snippets to you because NCsoft changed a little bit in Aion and now i want to share a new Facting to X Y method. ;)
Thanks to PharmerPhale for some help. :)
C# Code
private double RotNeeded(float X, float Y)
{
|
All times are GMT +1. The time now is 23:13.
|
|