Raised This Month: $ Target: $400
 0% 

Errors! XP-mod Help please


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Frozen Usp
Member
Join Date: Sep 2007
Location: Sweden
Old 10-07-2007 , 13:30   Errors! XP-mod Help please
Reply With Quote #1

This Mod Worked Great With XunTrics Xp-Mod [TUT]
But some errors was relly annoying fixing so i decided to try PM's Version!

It worked better but when i put skills in for classes this happen!
Help please


Here is Errors!

Code:
Error: Empty statement on line 129 Error: Empty statement on line 133 Error: Empty statement on line 137 Error: Empty statement on line 141 Error: Empty statement on line 161 Warning: Tag mismatch on line 216

Here is Code!
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <nvault> #define PLUGIN "Team Fortress Mod - Counter Strike STYLE" #define VERSION "1.0b" #define AUTHOR "Frozen Usp" #define TASK_REGEN 999 #define MAXCLASSES 5 #define NUM_OF_LEVELS 20 new pclass:g_PlayerClass[33]; new g_PlayerXP[33]; new g_PlayerLevel[33]; new curweapon[33] new g_vault enum pclass { CLASS_NOTHING=0, CLASS_SCOUT, CLASS_SOLDIER, CLASS_HWGUY, CLASS_MEDIC, NUM_OF_CLASSES } new const CLASS_NAMES[NUM_OF_CLASSES][] = { "None", "Scout", "Soldier", "HwGuy", "Medic" } new gmsgStatusText; new const LEVELS[NUM_OF_LEVELS] = { 100, 200, 300, 450, 500, 700, 800, 900, 1100, 3200, 4000, 4500, 5000, 5500, 6000, 6600, 7700, 8800, 9900, 15000 } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("amx_tfcmod" , "1") register_cvar("XP_per_kill", "20") register_cvar("SaveXP","1") register_clcmd("say /changeclass", "ChooseClass") register_clcmd("say_team /changeclass", "ChooseClass") register_clcmd("say /level", "ShowHUD") register_clcmd("say_team /level", "ShowHUD") register_clcmd("say /savexp", "SaveXP") register_clcmd("say_team /savexp", "SaveXP") register_clcmd("fullupdate","on_fullupdate") register_event("CurWeapon", "Event_CurWeapon", "be","1=1") register_event("DeathMsg", "DeathMsg", "ae") register_event("ResetHUD","on_spawn","be") register_menucmd(register_menuid("menu_ChooseClass"),1023,"MenuAction_ChooseClass") gmsgStatusText = get_user_msgid("StatusText") g_vault = nvault_open("VAULT") } public on_fullupdate(id) { return PLUGIN_HANDLED ; } public on_spawn(id) { // give the user 50 extra health if( g_PlayerClass[id] == CLASS_HWGUY); set_user_health(id,200) // and 100 points of armour + a helmet if( g_PlayerClass[id] == CLASS_HWGUY || g_PlayerClass[id] ==CLASS_SOLDIER); cs_set_user_armor(id,150,CS_ARMOR_VESTHELM) // and reduce their gravity to half if( g_PlayerClass[id] == CLASS_SCOUT || g_PlayerClass[id] ==CLASS_SOLDIER); set_user_gravity(id,0.7) // and in 5 seconds, call the on_regen function if( g_PlayerClass[id] == CLASS_MEDIC); set_task(5.0,"on_regen",TASK_REGEN+id) } public on_weaponevent(id) { new dummy ; new tempweapon = get_user_weapon(id,dummy,dummy) // get their current weapon if ( tempweapon != curweapon[id] ) {     // if they have changed weapon store their new weapon     curweapon[id] = tempweapon     set_user_maxspeed(id,(get_user_maxspeed(id)*1.5)) } } public Event_CurWeapon(id) if( g_PlayerClass[id] == CLASS_SCOUT || g_PlayerClass[id] ==CLASS_MEDIC); { set_user_maxspeed(id,400.0) } }   public on_regen(id) { // here, we take away the constant part of the task's id ( 999 ) // and are left with just the player id // (the task id is 999 + player's id ) if ( id > TASK_REGEN ) id -= TASK_REGEN ; // don't regen dead people ! if ( !is_user_alive(id) )     return ; // give user 5 hp set_user_health(id,get_user_health(id)+5) // and do it again in 5 seconds set_task(5.0,"on_regen",TASK_REGEN+id) } public SaveXP(id) { new AuthID[35] get_user_authid(id,AuthID,34) new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-CLASS",AuthID) format(vaultdata,255,"%i#%i#%i#",g_PlayerClass[id],g_PlayerXP[id],g_PlayerLevel[id]) nvault_set(g_vault,vaultkey,vaultdata) return PLUGIN_HANDLED } public LoadXP(id) { new AuthID[35] get_user_authid(id,AuthID,34) new vaultkey[64],vaultdata[256] format(vaultkey,63,"%s-CLASS",AuthID) format(vaultdata,255,"%i#%i#%i#",g_PlayerClass[id],g_PlayerXP[id],g_PlayerLevel[id]) nvault_get(g_vault,vaultkey,vaultdata,255) replace_all(vaultdata, 255, "#", " ") new playerclas[32], playerxpp[32], playerlv[32] parse(vaultdata, playerclas, 31, playerxpp, 31, playerlv, 31) g_PlayerClass[id] = str_to_num(playerclas) g_PlayerXP[id] = str_to_num(playerxpp) g_PlayerLevel[id] = str_to_num(playerlv) return PLUGIN_HANDLED } public ChooseClass(id) { new menu[] = "TFC Mod: Choose Class^n^n1. Scout^n2. Soldier^n3. HwGuy^n4. Medic^n^n0. Exit" new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3 show_menu(id, keys, menu, -1, "menu_ChooseClass")     } public MenuAction_ChooseClass(id, pclass:key) { // The keys map to the pclass ids (I think), so no need to have a big if construct;) if (key == g_PlayerClass[id]) {     client_print(id, print_chat, "[TFC Mod] You are already a %s! Choose something else!", CLASS_NAMES[key]);     ChooseClass(id);     return; } client_print(id, print_chat, "[TFC Mod] You are now a %s!", key); g_PlayerClass[id] = key;       ShowHUD(id); } public ResetHUD(id) { if (g_PlayerClass[id] == CLASS_NOTHING)     ChooseClass(id); } public DeathMsg() { if (!get_cvar_num("amx_tfcmod"))     return; new attacker = read_data(1) if (g_PlayerClass[attacker] == CLASS_NOTHING)     return; if(g_PlayerLevel[attacker] == NUM_OF_LEVELS)     return; g_PlayerXP[attacker] += get_cvar_num("XP_per_kill") if(g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]]) {     ++g_PlayerLevel[attacker];         client_print(attacker, _:print_chat, "[TFC Mod] Congratulations! You are now level %i!", g_PlayerLevel[attacker]) } ShowHUD(attacker); } public client_connect(id) { // A client is coming -> clear all vars for him, so that he doesn't have the pclass/level/xp of the player who was in here before him g_PlayerClass[id] = CLASS_NOTHING; g_PlayerXP[id] = 0; g_PlayerLevel[id] = 0; } public client_disconnect(id) { if(get_cvar_num("SaveXP") == 1) {         SaveXP(id) } } ShowHUD(id)     { new HUD[51] format(HUD, 50, "[%s]Level: %i XP: %i", CLASS_NAMES[g_PlayerClass[id]], g_PlayerLevel[id], g_PlayerXP[id]) message_begin(MSG_ONE, gmsgStatusText, {0,0,0}, id) write_byte(0) write_string(HUD) message_end() }
Frozen Usp is offline
Send a message via MSN to Frozen Usp
 



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 16:13.


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