How to save player data?
Hey, so I want to make a plugin for this dude on this post and I started making it. And after a while I was wondering how to save data from players. So here is the concept.
I want to make a plugin that when you hit level 10 (OciXCrom XP Plugin), you will have classes and you can choose your class, every class has different "abilities". Now what I did is simple checking for player current level and making menus. And the way it is now, its quite simple, but when you have more classes , how do you remember which class did that player choose, how do I store which class did that player have, and store his "id". |
Re: How to save player data?
If you're looking to save multiple pieces of data for each player, I would use nVault Array or SQL. I would create an enumerator for all data components and size the array with that, and use steam id as the key.
PHP Code:
|
Re: How to save player data?
So that would save data for each player, if this works how I think it is, this is awesome. I'm sorry if this question is kinda dumb, I started coding like 7-8 days ago :)
|
Re: How to save player data?
Yea, but you still need to know what you're doing to make it work correctly. This may be too big of a job at your experience level, but give it a try.
|
Re: How to save player data?
Quote:
There is something in helping people that makes you feel better about yourself. I learned pawning for myself, but I have nothing to do with it now so I can at least help others. |
Re: How to save player data?
Yeah if you have background in other languages, like C or something similar, you should pick it up pretty easy..at least for syntax.
The way the game/plugins work you may need some help with. |
Re: How to save player data?
So I got a quick look at this and if I got it correctly, you can store your arrays, strings and what not, and than just pull it from PlayerData, than I can just see if there is a player who isn't stored in PlayerData?
Edit: I could even do read_data() right? |
Re: How to save player data?
Using what I posted above, you would set data to the player array like this:
PHP Code:
Not sure what you mean with read_data(). This is used to read a parameter of a game event, like the killer or victim ID in a DeathMsg. This is a good reference: http://www.amxmodx.org/api/ |
Re: How to save player data?
I think I get it, thanks for replying so quickly
|
| All times are GMT -4. The time now is 17:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.