Levels with XP, like wc3
Hey - Can someone explain to me how i can add addtional experince to a player when he shot a client? Just like in wc3 mod.
|
catch the damage event and u can give xp based off of the dmg or by a kill.
|
Yes i know, but how can i save the XP, so the script remembers what the actual XP are for a client
Code:
|
it would remember it if it was global until it was changed or the map changed. Thats why the wc3 saves your xp to a vault.ini.
|
Can you give an example please? ;S
|
so say we have a plugin, you would declare a global variable like so...
Code:
|
okay - But how can i give a use the XP that he have deserved
|
look up vault.. what i did was d/ld the uwc3 source code, you can learn a hell of a lot from there, as well as by searching then posting on these forums, and last but not least use the functionwiki thing on the main page. It's extremely helpful but sometimes confusing. Using vault is really really easy:
//save exp set_vaultdata (key, data) //set_vaultdata (USER_exp, userexp[2]) //save player 2s exp get_vaultdata (key, data) //get_vaultdata (USER_exp, userexp[2])//load player 2s exp You wouldn't actually do this, you would use steam ids and player ids and so forth, but that's the 2 basic vault commands.. another one is: vaultdata_exists(data) //if(vaultdata_exits(USER_exp)) //see if user has any exp saved or not (extremely useful for setting up new players) that's basically it... have fun :) |
|
Hrmph, im a little noobi to this scripting thing, one of you cant you make a function, that would give a user 20 xp, per kill.
And it would be very good if you could add some comments into the script... |
| All times are GMT -4. The time now is 09:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.