 |
|
Veteran Member
|

11-24-2010
, 17:03
Re: Save level based on class (XP Mod)
|
#7
|
Quote:
Originally Posted by Exolent[jNr]
Here's an example of how I would've done the code in your first post.
PHP Code:
public SaveData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64], vaultdata[11]
formatex(vaultkey,63,"%s-xp",AuthID)
num_to_str(PlayerXP[id],vaultdata,10)
nvault_set(g_vault,vaultkey, vaultdata)
formatex(vaultkey,63,"%s-level",AuthID)
num_to_str(PlayerLevel[id],vaultdata,10)
nvault_set(g_vault,vaultkey, vaultdata)
}
PHP Code:
public LoadData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64]
formatex(vaultkey,63,"%s-xp",AuthID)
PlayerXP[id] = nvault_get(g_vault,vaultkey)
formatex(vaultkey,63,"%s-level",AuthID)
PlayerLevel[id] = nvault_get(g_vault,vaultkey)
}
|
Well the way I see it, if I used your method, then no matter what class the person is, their level would stay the same. So now we're back to the reason why I created the topic.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
|
|
|
|