Raised This Month: $ Target: $400
 0% 

Exp system


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-13-2005 , 22:17   Exp system
Reply With Quote #1

Hey, I was wondering if anybody could at the very least show me an example on how to make an exp system.

I get the..

Code:
new Playerxp[33] new levels[5] = {100,200,400,800,1600};

I just don't get what to do after that.
__________________
KyleD is offline
Send a message via MSN to KyleD
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-13-2005 , 23:29   Re: Exp system
Reply With Quote #2

Quote:
Originally Posted by KyleD
Hey, I was wondering if anybody could at the very least show me an example on how to make an exp system.
I'd like you to more be vague, please, it'd really help me make you an example.

"an exp system" is a very, very, very broad subject. What mod is it? That's pretty important. Also, how the heck do you even want it to work? There are gillions of ways to make exp systems.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-13-2005 , 23:49  
Reply With Quote #3

Your right.
I would like to make and exp system that works like UltimateWarCraft3 mod. I would like it to work for counter-strike and I was going to attempt to make a mod called "HaloMod". Just 2 basic sides where you dont changeclass your basicaly get better upgrades. So basicaly heres how it would work...

2 sides
exp is based on frags
when new lvl is gained class dont change but skills will

Hopefully that gave you a better understanding for what im looking for.
__________________
KyleD is offline
Send a message via MSN to KyleD
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-14-2005 , 02:21  
Reply With Quote #4

Code:
#include <amxmodx> #define XP_FOR_KILL 50 #define MAX_LEVEL 10 new playerxp[33]; new level[33]; public plugin_init() {    register_event("DeathMsg","event_deathmsg","a"); } public event_deathmsg() {    new victim = read_data(2);    new attacker = get_user_attacker(victim);    if(!is_user_connected(attacker) || attacker == victim) {       return PLUGIN_CONTINUE;    }    if(level[attacker] < MAX_LEVEL) {       playerxp[attacker] += XP_FOR_KILL;       check_for_new_level(attacker);    }    return PLUGIN_CONTINUE; } // long function name, eh? public check_for_new_level(id) {    new xpneeded = get_user_nextxp(id);    if(playerxp[id] > xpneeded) {       level[id]++;       // congratulatory stuff here    } } public get_user_nextxp(id) {    new currxp = 100;    for(new i=0;i<level[id];i++) {       currxp *= 2;    }    return currxp; }

There's a start.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-14-2005 , 02:58  
Reply With Quote #5

Could you explain to me the "read_data(2)" part because it says
- undefiend symbol "victim"..
__________________
KyleD is offline
Send a message via MSN to KyleD
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-14-2005 , 16:45  
Reply With Quote #6

Whoops, used "victim" in place of "id" in the function to get the user's next experience amount. Anyway, read_data(2) grabs the 2nd parameter from the DeathMsg event, which is the killer.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-14-2005 , 17:21  
Reply With Quote #7

Now, is the code you just posted supposed to give the attacker 50 xp everytime he kills the victim? I tested it, but when I killed another person I didn't get what I was supposed to get which was a weapon.
__________________
KyleD is offline
Send a message via MSN to KyleD
Ced
Member
Join Date: Oct 2004
Old 04-14-2005 , 20:53  
Reply With Quote #8

his example only adds xp into an array for your id when u kill somebody and u get lvls up to 10
Ced is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-14-2005 , 22:11  
Reply With Quote #9

Quote:
Originally Posted by KyleD
I didn't get what I was supposed to get which was a weapon.
What? You're supposed to get a weapon?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-15-2005 , 15:06  
Reply With Quote #10

Yeah.

Code:
// long function name, eh? public check_for_new_level(id) {    new xpneeded = get_user_nextxp(id);    if(playerxp[id] > xpneeded) {       level[id]++;       // congratulatory stuff here    } }

I put "give_item(id,"weapon_m4a1") for // congratulatory stuff here

And what I thought was gonna happen was when I killed a person it would have given me the m4a1.
__________________
KyleD is offline
Send a message via MSN to KyleD
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:58.


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