Raised This Month: $ Target: $400
 0% 

Good programmers, I need help with XP system...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-06-2005 , 13:06   Good programmers, I need help with XP system...
Reply With Quote #1

Hey im working on a new big plugin with xp system.
When you level up, there isnt any upgrade menu.
The upgrades are auto, depending on what class you are.
When you level up, it shows a motd style window that says all the upgrades you got.
But this is annyoing, if you level up in the middle of a round, and that window shows up on their screen when they get attacked.
So what i want, is to get that message to show up on next round instead, so they wont get attacked when reading.
So i want it to show up with the ResetHud function on next round.
How do i make it show up on next round?
I know i just can put the upgrade motd lines in ResetHud, but then that window will show up every round.
I just want it to show up next round after you got a level, and not all rounds.
I got so you can say "/level" and that message will show up, but i want it on next round after you level up too.

Hope somebody can help!
Thanks
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-06-2005 , 13:34  
Reply With Quote #2

Common logic man, sheesh!

When they level set a variable to 1. On ResetHUD, if that variable is 1, display the MoTD window and set that variable to 0.

Easy.

Come on, now.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-06-2005 , 13:53  
Reply With Quote #3

Omg didnt know it was that easy.

Can you just give me a example so im sure?
-----------------------------------------------
EDIT:
Im pretty unsure really. I've never done that before
Should i make a clcmd?
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-06-2005 , 17:50  
Reply With Quote #4

...Why would you need a client command for that?

You know about variables, right?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-07-2005 , 07:50  
Reply With Quote #5

I started learning AMX Mod X a month ago, and havnt really used that kind of code before... Can you just tell me how to do it?
XunTric is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-07-2005 , 07:59  
Reply With Quote #6

This is just a example... Is this right?
Code:
public plugin_init() {     register_cvar("upgrades", "0") } public event_DeathMsg(id) {     new attacker = read_data(1)       g_playerXP[attacker] += (g_playerLevel[id] * 5) + 3000     if(g_playerXP[attacker] >= LEVELS[g_playerLevel[attacker]]) {         g_playerLevel[attacker] += 1         set_cvar_num("upgrades", "1")     }     return PLUGIN_CONTINUE } public ResetHud {     if (upgrades == 1)     {     //code     set_cvar_num("upgrades", "0")     } }

Note: Dont care about the XP code... I know that part works... Just to show you.
XunTric is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-07-2005 , 15:04  
Reply With Quote #7

Sorry for the spam, but my thread was going far down on the thread list.
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-07-2005 , 16:29  
Reply With Quote #8

My goodness man, have you ready any tutorials? Variables are like the most freakishly important building block. I don't see how you could have made so much of your plugin already and not know about variables.

Go read the tutorials.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 03-07-2005 , 16:54  
Reply With Quote #9

lol, if you try that code at all with resetHUD your gonna spam the hell out of people with motd, thats if it doesn't crash the server :/ ......
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-07-2005 , 17:29  
Reply With Quote #10

arent u suppose to register a new round or something? becuz im pretty sure ResetHud gets called mroe than once a round.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
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 14:11.


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