[FilterScript] Experience system + Simple Account System
#1

Experience System & Simple Account System By King_Hual


Hello there. Here's another one of my scripts. It's an experience and level up system and a simple Account system.

Requirements:
You will need the includes "dudb" and "progress" which I have included in the file.

Version 1.0:
Here are the functions I created which you can use:

Код:
GivePlayerExp(playerid, ammount); //Gives the selected ID the selected ammount of experience.
GetPlayerExpLevel(playerid); //Returns the selected ID's Experience Level
GetPlayerExp(playerid); //Returns the selected ID's Experience
GetPlayerTotalExp(playerid); //Returns the selected ID's Total Experience (Experience needed to level up)
Here are the defines you can edit:
Код:
#define ExpForLevel 1000 //How much exp you need to pass a level. The Exp gets multiplied by the level. If you've got 1000 total exp then for lvl 2 it will be 2000
#define MaxLevel 99 //The maximum level a player can achieve.
#define UseProgBar // Define wheater to use the progress bar or not. Comment the line if you don't want a progress bar and leave like that if you do want a progress bar.
#define ProgBarColor 0x0000FFFF //The experience bar's color.
#define TextLabelColor 0x00FFFFFF // The textlabel's color.
#define CashForLevelUp 300 //This is the cash you get for levelling up. It gets multiplied by the level you achieved and one more time by a number you define.
#define CashMultiplier 1 //This multiplies the Cash * Level achieved by the number you want.
Version 1.1:
Edited Function "GivePlayerExp". Added reason. It's now:
Код:
GivePlayerExp(playerid, exp, reason[])
Added new defines:
Код:
#define GameTextStyle 4 //This defines the GameText's style used for the GivePlayerExp function.
#define GameTextTime 3000 //This defines the time for which the GameText for the GivePlayerExp function will be visible
Added example code in the script:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	if (killerid != playerid) {
	    if (GetPlayerExpLevel(playerid) < GetPlayerExpLevel(killerid))
	    {
    		GivePlayerExp(killerid, 100, "killing a lower level player");
	    }
	    else if (GetPlayerExpLevel(playerid) > GetPlayerExpLevel(killerid))
	    {
	    	GivePlayerExp(killerid, 300, "killing a higher level player");
	    }
	    else
	    {
	    	GivePlayerExp(killerid, 200, "killing a player at your own level");
	    }
	} // An example of using my exp system.
	return 1;
}
Well I hope you like it!

Screenshots:
Without Progress Bars:

With Progress Bars:



Video:
[ame]http://www.youtube.com/watch?v=haQuId0OGIw[/ame]

Special thanks to Michael@Belgium for helping me

Created by King_Hual

Version 1.0 Pastebin:
http://pastebin.com/4zxmbwpv

Version 1.1 Pastebin:
http://pastebin.com/xEp83EeS

!!!DON'T FORGET TO CREATE A FOLDER NAMED "HAccounts" IN YOUR SCRIPTFILES FOLDER AND TO PUT THE FILTERSCRIPT IN 1ST PLACE IN THE .cfg FILE!!!

Downloads:
Reply
#2

Cool useful for dm and tdms nice work
Reply
#3

Quote:
Originally Posted by lordturhan
Посмотреть сообщение
Cool useful for dm and tdms nice work
Well you can use it for everything It can also be useful for RPG servers
Reply
#4

haha Good FS !
Reply
#5

Nice one i will use this to my script, thank you very much.
Reply
#6

Quote:
Originally Posted by WoodPecker
Посмотреть сообщение
Nice one i will use this to my script, thank you very much.
You're welcome Glad you like it
Reply
#7

VERY NICE! Can the reason for XP be edited?
Reply
#8

Quote:
Originally Posted by cruteX_modshop
Посмотреть сообщение
VERY NICE! Can the reason for XP be edited?
Well there's no reason for exp but ill create it in a minute. Thank you for the suggestion.
Reply
#9

No problem. I meant like when does the player get exp? When he kill someone, finish something or?..
Reply
#10

Ok I updated it to 1.1. I made an option for reasons
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)