Raised This Month: $ Target: $400
 0% 

help with xp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
onfirenburnin420
Senior Member
Join Date: Jan 2005
Old 09-01-2005 , 01:26   help with xp
Reply With Quote #1

im trying to understand how xp plugins work. i slaped some coding together ( alot came from the Xp Tut) And Here Is Wut I Got... Sry Im A Noob.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <vault> new PlayerXP[33] new msgtext public plugin_init() {     register_plugin("Xp_Mod", "1.0", "Fire")         register_cvar("sv_xpmod", "1")         register_event("DeathMsg", "DeathMsg", "a")         register_cvar("XP_per_kill", "20")         msgtext = get_user_msgid("StatusText") } public SaveXP(id) {     new authid[32];     get_user_authid(id,authid,31);         new vaultkey[64], vaultdata[64];         format(vaultkey,63,"ANIMAL-%s-xp",authid);     format(vaultdata,63,"%d",PlayerXP[id]);     set_vaultdata(vaultkey,vaultdata); } public LoadXP(id) {     new authid[32];     get_user_authid(id,authid,31);         new vaultkey[64], vaultdata[64];         format(vaultkey,63,"ANIMAL-%s-xp",authid);     get_vaultdata(vaultkey,vaultdata,63);     PlayerXP[id] = str_to_num(vaultdata); } public client_connect(id) {     if(get_cvar_num("SaveXP") == 1) {                 LoadXP(id)                 client_print(id, print_chat, "[Xp_Mod] XP Loaded!")         client_print(id, print_chat, "[Xp_Mod] You Have %s XP")     } } public client_disconnect(id) {     if(get_cvar_num("SaveXP") == 1) {                 SaveXP(id)     } } public DeathMsg() {     if(get_cvar_num("sv_xpmod") == 0) {         return PLUGIN_HANDLED     }         new attacker = read_data(1)         PlayerXP[attacker] += get_cvar_num("XP_per_kill")         if(get_cvar_num("SaveXP") == 1) {                 SaveXP(attacker)     }         ShowHUD(attacker) }     ShowHUD(attacker) return PLUGIN_CONTINUE } public ShowHUD(id)     { new HUD[51] format(HUD, 50, "XP: %i", PlayerXP[id]) message_begin(MSG_ONE, msgtext, {0,0,0}, id) write_byte(0) write_string(HUD) message_end() return }
Can Some One Please Fix This to Give you Xp For Every kill... And Explain Wut You Did. Thanks Alot , Fire
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
 



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 14:28.


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