19.10.2011, 14:01
(
Последний раз редактировалось KingHual; 22.10.2011 в 11:38.
)
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)
Код:
#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.
Edited Function "GivePlayerExp". Added reason. It's now:
Код:
GivePlayerExp(playerid, exp, reason[])
Код:
#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
Код:
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; }
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: