Raised This Month: $ Target: $400
 0% 

Levels with XP, like wc3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-21-2005 , 19:34   Levels with XP, like wc3
Reply With Quote #1

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.
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Ced
Member
Join Date: Oct 2004
Old 04-21-2005 , 19:51  
Reply With Quote #2

catch the damage event and u can give xp based off of the dmg or by a kill.
Ced is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-21-2005 , 19:57  
Reply With Quote #3

Yes i know, but how can i save the XP, so the script remembers what the actual XP are for a client

Code:
new xp[32] // Would the script remember that all the time?
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Ced
Member
Join Date: Oct 2004
Old 04-21-2005 , 20:22  
Reply With Quote #4

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.
Ced is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-21-2005 , 20:27  
Reply With Quote #5

Can you give an example please? ;S
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Ced
Member
Join Date: Oct 2004
Old 04-21-2005 , 20:31  
Reply With Quote #6

so say we have a plugin, you would declare a global variable like so...
Code:
//Put our includes #include <amxmodx> // Then next we could declare a global new g_xp[33]
then plugin init could come next and so on
Ced is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-21-2005 , 21:12  
Reply With Quote #7

okay - But how can i give a use the XP that he have deserved
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-21-2005 , 21:37  
Reply With Quote #8

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
__________________
"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
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-21-2005 , 21:54  
Reply With Quote #9

http://forums.alliedmods.net/showthread.php?t=12518
__________________
KyleD is offline
Send a message via MSN to KyleD
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-22-2005 , 10:06  
Reply With Quote #10

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...
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Reply


Thread Tools
Display Modes

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 09:57.


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