Raised This Month: $51 Target: $400
 12% 

XP Based Plugin - Tutorial!


Post New Thread Reply   
 
Thread Tools Display Modes
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 04-17-2005 , 11:57  
Reply With Quote #11

My code is working now!

Muhahahaha go to sleep PM

(Ops sorry for not using edit )
XunTric is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-17-2005 , 12:08  
Reply With Quote #12

Quote:
Originally Posted by XunTric
You didnt have to steal my thread

Well... Thanks PM
I credited you.

And btw, I use this on my code on my mod, and I doesnt have to set class to "nothing" when they connect.
Since its first class, it chooses it auto (I think). Well, works for me...
And if im going to add save XP later, it cant reset all stuff on connect?
Well, it's true that the compiler initializes variables to 0 (which is CLASS_NOTHING in your case), but imagine this situation:

1)A player connects, the engine gives him id 1
2)An other player connects, the engine gives him id 2
3)Player with id 1 kills player with id 2, thus he has some XP now
4)Player with id 1 leaves
5)An other player connects, and gets id 1 again. Now the plugin thinks that this player already has some XP


BTW: Your DoChooseAnimal function is weird =P
__________________
hello, i am pm
PM is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 04-17-2005 , 12:18  
Reply With Quote #13

Hmm...
Thats a problem, yes...

This is just the "base" of a XP plugin.
People can add that stuff on client_connect if they want to.

I'll maybe add save XP later, and then I'll try to solve that problem.

Btw PM do you know a lot of saving XP and that stuff?
I dont know much about saving XP (almost nothing really )

Btw: If ur going to help, send me a PM with the code this time.
XunTric is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 04-17-2005 , 12:49  
Reply With Quote #14

To save XP, you could use one of the following methods:
1) Vault (either the old one, or the new one, or Twilight Suzuka's one)
2) MySQL
3) Writing to a file

I myself would support the new vault and mysql.
__________________
hello, i am pm
PM is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-17-2005 , 13:38  
Reply With Quote #15

Thanx man, definetitaly (sp? lol) worth reading through (I read most of it lol) and learning. Quick question though: why are you using cvars instead of just regular script vars for all that stuff?
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 04-17-2005 , 14:04  
Reply With Quote #16

Quote:
Originally Posted by PM
To save XP, you could use one of the following methods:
1) Vault (either the old one, or the new one, or Twilight Suzuka's one)
2) MySQL
3) Writing to a file

I myself would support the new vault and mysql.
I know the methods I can save XP with, its just how to code it?
I dont know what commands to use, how to use em, and where to place em.

Quote:
Originally Posted by BioHazardousWaste
Thanx man, definetitaly (sp? lol) worth reading through (I read most of it lol) and learning. Quick question though: why are you using cvars instead of just regular script vars for all that stuff?
Because then you can change "XP per kill" easy, instead of editing the script.
XunTric is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-17-2005 , 14:27  
Reply With Quote #17

right, right... wow, stupid question, sorry.... I also was wondering how to save exp. Need functions, calls and what-not
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 04-17-2005 , 14:29  
Reply With Quote #18

Quote:
Originally Posted by BioHazardousWaste
right, right... wow, stupid question, sorry.... I also was wondering how to save exp. Need functions, calls and what-not
The problem is that I dont really know how to save XP yet.

If you readed thru the topic you would see that I asked PM for help.
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-17-2005 , 20:07  
Reply With Quote #19

Something I noticed:

Code:
//Add keys for how many classes you have. In our case 5.(4 animals + exit) (Not 6, since "CLASS_NOTHING" doesnt count) //Remeber at it starts at 0, and not 1 new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3

That isn't true. MENU_KEY_0 is actually the 0 key, and MENU_KEY_1 is actually the 1 key. This will only let users pick 1, 2, 3, and 0, thus crippling Cow lovers. Also, even using your logic, this wouldn't let players pick Exit. You need this:

Code:
new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0;

That whole "starts at 0" thing is only in the function that handles menu input.
__________________
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 04-18-2005 , 08:27  
Reply With Quote #20

I do it in my way and it works for me.
XunTric is offline
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 11:57.


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