Raised This Month: $ Target: $400
 0% 

[NEED HELP] [TMod] Help me with my mod here!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 08-01-2006 , 09:53   [NEED HELP] [TMod] Help me with my mod here!
Reply With Quote #1

Hi!

I am making an XP mod and i need some help.
Those who help me will be credited and get +Karma.
I will post the code here in this thread, in this post, when its get updated.
If you want to help, just help!
You can BETA-test this on your server if you want to...

------------------------------------
DONT steal my idea of this mod
DONT tell me im a noob cause i know im a noob in coding (this is my first mod, believe or not!)
YOU CAN tell me to (PPL has already told me to do this -.-)
------------------------------------

What i need right now:
  • More HP&AP script
  • Less gravity script
  • More damage script
  • Find out why the menu doesnt work
  • To RTFM
------------------------------------

Code updated...
060808 - 17:15
060802 - 14:50
060801 - 22:45
060801 - 18:00


Readme:
Code:
/* Plugin generated by AMXX-Studio */ /*************************************** ----------TMod - Choose tactic Mod------ -----Author: TheLinx -----Credits: XunTric - For making original code snippet - NOTE: XunTric is banned from AlliedModders forums.. PM - For updating code snippet teame06 - For helping RapHero2000 - For helping Lord_Destros - For helping Hawk552 - For helping MysticDeath - For not helping :D Mini_Midget - For reffering me to AmxModX FuncWiki -----Changelog: --1.9 Added effects for classes "CLASS_JUMP" and "CLASS_STAY" Rewritten the whole code and switched some names of events and stuff Deleted XP per plant and XP per defuse Added an help MOTD Maked the code more nicelooking with some //----------[]---------- ;) Added section "Other useless info XD" in readme **Hooray!** --1.8 Test deleted SaveXP...no i just turned it off >.< --1.7 Added xp per plant Added xp per defuse Added CVAR "tmod_xpperplant" Added CVAR "tmod_xpperdefuse" --1.6 Included VAULT -Edited line 145 from: ChooseTactic(id) to: public ChooseTactic(id) --- Deleted multilang - I got other stuffs to do... Added section Description in readme --1.5 Maked Tactic Mod multilingual (For testing purposes) Fixed ShowHUD problems Fixed CLASS_NOTHING bug Added effects to all classes but CLASS_SHOOT Edited CVARS so all CVARS starts with tmod_ Added section CVARS in readme --1.4 The base code is fixed Added test effect to CLASS_RUN --1.3 Updated the whole code --1.2 Fixed effects for 3 classes --1.1 Fixed HUD problems --1.0 The plugin is born! Its just one thing, YOU JUST GET XP! DOH! -----Known bugs: Doesn´t have effects To say /choosetactic doesnt work To say /tmodhelp doesnt work -----CVARS: --tmod_onoroff Default is "1" - Sets if Choose Tactic mod is on or off - "1" Enables it and "0" Disables it --tmod_xpperkill Default is "25" - Sets how much xp you get per kill - Example: "tmod_xpperkill 50" makes so you get 50 xp per kill --tmod_savexp Default is "1" - Sets if SaveXP is on or off - "1" Enables it and "0" Disables it -----Description: This is an mod which will let you choose an tactic. If you kill people you will get XP and if you level up, you will get better in the class. The maximum level is 9, after you are level 9, you cant get more XP. The classes is: --Run for your life! -Script name: CLASS_RUN -What you get: More runspeed per level --Shoot him! SHOOT HIM! -Script name: CLASS_SHOOT -What you get: More damage per level --Jump to safety -Script name: CLASS_JUMP -What you get: Less gravity per level --Just stay there -Script name: CLASS_STAY -What you get: More HP&AP per level -----Other useless info XD: Lined of code: 404 (Including readme) File size: 30520 bytes The plugin was made with AMXX-studio PPL told me to RTFM -.- //----------[]---------- ********************************/

--------------------------------

The current code (Without readme):
Code:
  //----------[Includes]---------- #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <csx> //----------[Class script names]---------- enum pclass {  CLASS_NOTHING = 0,  CLASS_RUN,  CLASS_SHOOT,  CLASS_JUMP,  CLASS_STAY,  NUM_OF_CLASSES } //----------[Defines]---------- #define MAX_PLAYERS 32 //----------[Register commands]---------- new pclass:g_PlayerClass[33]; new g_PlayerXP[33]; new g_PlayerLevel[33]; new gmsgStatusText; new bool:g_restart_attempt[MAX_PLAYERS + 1] //new g_PlayerHP[33] //new g_PlayerAP[33] //----------[Class names]---------- new const CLASS_NAMES[NUM_OF_CLASSES][] = {  "do nothing.",  "Run for your life!",  "Shoot him! SHOOT HIM!!",  "Jump to safety",  "Just stay there" } //----------[Number of levels]---------- #define NUM_OF_LEVELS 5 //----------[XP you need per level]---------- new const LEVELS[NUM_OF_LEVELS] = {  100,  200,  400,  800,  1600, } //----------[Plugin info]---------- #define PLUGIN "Choose Tactic Mod (TMod)" #define VERSION "1.9" #define AUTHOR "TheLinx //----------[Plugin init]---------- public plugin_init() {  //----------[Plugin info]----------  register_plugin("PLUGIN", "VERSION", "AUTHOR")  //----------[CVARS]----------  register_cvar("tmod_onoroff", "1")  register_cvar("tmod_xpperkill", "25")  register_cvar("tmod_savexp", "1")  register_cvar("tmod_version", VERSION)  //----------[Events]----------  register_event("DeathMsg", "Msg_on_death", "a")  register_event("CurWeapon", "event_cur_weapon", "be", "1=1")  register_event("ResetHUD", "hud_do_reset", "be")  register_event("TextMsg", "do_restart_attempt", "a", "2=#Game_will_restart_in")  //----------[Menus]----------  register_menucmd(register_menuid("menu_tactic_do_choose"), 0123, "menuaction_tactic_do_choose")  //----------[Commands]----------  register_clcmd("say /choosetactic", "Tactic_do_choose")  register_clcmd("say /tmodhelp", "motd_tmod_help")  register_clcmd("fullupdate", "clcmd_fullupdate")  //----------[Other]----------  gmsgStatusText = get_user_msgid("StatusText") } //----------[Choose tactic menu]---------- public Tactic_do_choose(id) {  new menu[] = "TMod: Choose Tactic:^n^n1. Run for your life!  Higher speed^n2. Shoot him! SHOOT HIM!!  More damage^n3. Jump to safety.  Less gravity^n4. Just stay there.  More HP and AP^n^n0. Close"  new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3    show_menu(id, keys, menu, -1, "menu_tactic_do_choose") } //----------[Choose tactic menu Actions]---------- public menuaction_tactic_choose_tactic(id, pclass:key) {  if(key == g_PlayerClass[id])  {   client_print(id, print_chat, "[TMod] Your tactic is already to %s! Choose something else!", CLASS_NAMES[key], 0);   Tactic_do_choose(id);   return;  }  client_print(id, print_chat, "[TMod] Your tactic is now to %s!", key);  g_PlayerClass[id] = key;  hud_do_show(id); } //----------[Resets the HUD]---------- public hud_do_reset(id) {  if(g_PlayerClass[id] == CLASS_NOTHING)  {   Tactic_do_choose(id);  }  if(g_restart_attempt[id])  {   g_restart_attempt[id] = false   return  }  event_player_spawn(id)   } //----------[Stuff that will execute on death]---------- public Msg_on_death() {  if(get_cvar_num("tmod_onoroff") == 0)  return;    new attacker = read_data(1)    if(g_PlayerClass[attacker] == CLASS_NOTHING)  {   client_print(attacker, _:print_chat, "[TMod] To gain XP from killing people, choose an tactic by saying /ChooseTactic", 0, 0)   return;  }    if(g_PlayerLevel[attacker] == NUM_OF_LEVELS)  {   return;  }    g_PlayerXP[attacker] += get_cvar_num("tmod_xpperkill")    if(g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]])  {   ++g_PlayerLevel[attacker];   client_print(attacker, _:print_chat, "[TMod] Congratulations! You leveled up! Your new level is %i!", g_PlayerLevel[attacker], 0)  }  hud_do_show(attacker); } //----------[The HUD that shows In-game]---------- public hud_do_show(id) {  new HUD[51]  format(HUD, 50, "[Tactic: %s]Level:m %i/%i XP: %i", CLASS_NAMES[g_PlayerClass[id]], g_PlayerLevel[id], NUM_OF_LEVELS, g_PlayerXP[id], 0)  message_begin(MSG_ONE, gmsgStatusText, {0,0,0})  write_byte(0)  write_string(HUD)  message_end() } //----------[Executed when a client connects]---------- public client_connect(id) {  if(get_cvar_num("tmod_savexp") == 1)  {   do_load_xp(id)   client_print(id, print_chat, "[TMod] XP Loaded!")   client_print(id, print_chat, "[TMod] Your tactic is to %s with level %s and XP %s", g_PlayerClass[id], g_PlayerLevel[id], g_PlayerXP[id])  }  else  {   g_PlayerClass[id] = CLASS_NOTHING;   g_PlayerXP[id] = 0;   g_PlayerLevel[id] = 0;  } } //----------[Executed when a client disconnects]---------- public client_disconnect(id) {  if(get_cvar_num("tmod_savexp") == 1)  {   do_save_xp(id)  } } //----------[The SaveXP stuff]---------- public do_save_xp(id) {      new authid[32];      get_user_authid(id,authid,31);      new vaultkey[64], vaultdata[64];            format(vaultkey,63,"TMOD-%s-CLASS",authid);      format(vaultdata,63,"%d",g_PlayerClass[id]);      set_vaultdata(vaultkey,vaultdata);      format(vaultkey,63,"TMOD-%s-XP",authid);      format(vaultdata,63,"%d",g_PlayerXP[id]);      set_vaultdata(vaultkey,vaultdata);      format(vaultkey,63,"TMOD-%s-LEVEL",authid);      format(vaultdata,63,"%d",g_PlayerLevel[id]);      set_vaultdata(vaultkey,vaultdata); } //----------[The LoadXP stuff]---------- public do_load_xp(id) {  new authid[32];  get_user_authid(id,authid,31);  new vaultkey[64], vaultdata[64];  format(vaultkey,63,"TMOD-%s-CLASS",authid);  get_vaultdata(vaultkey,vaultdata,63);  g_PlayerClass[id] = str_to_num(vaultdata);  format(vaultkey,63,"TMOD-%s-XP",authid);  get_vaultdata(vaultkey,vaultdata,63);  g_PlayerXP[id] = str_to_num(vaultdata);    format(vaultkey,63,"TMOD-%s-LEVEL",authid);  get_vaultdata(vaultkey,vaultdata,63);  g_PlayerLevel[id] = str_to_num(vaultdata);   } //----------[Effect for class "CLASS_RUN"]---------- public event_cur_weapon(id) {  if(g_PlayerClass[id] == CLASS_RUN)  {   new Float:Speed = 320.0+(g_PlayerLevel[id]*50)   set_user_maxspeed(id, Float:Speed)  } } //----------[The help MOTD]---------- public tmod_motd_help(id,level,cid) {  if(!cmd_access(id,level,cid,1))  return PLUGIN_CONTINUE    show_motd(id,"tmodhelp.txt","TMod Help")  return PLUGIN_CONTINUE } //----------[Full update]---------- public clcmd_fullupdate() {  return PLUGIN_HANDLED } //----------[Restart attempt]---------- public do_restart_attempt() {  new players[32], num  get_players(players, num, "a")  for (new i; i < num; ++i)  g_restart_attempt[players[i]] = true } //----------[This is executed when player spawns]---------- public event_player_spawn(id) {  if(g_PlayerClass[id] == CLASS_STAY)  {   new currenthp = get_user_health(id)   new morehp   morehp = (g_PlayerLevel[id]*25)   new sethp = currenthp + morehp   set_user_health(id, sethp)     new currentap = get_user_armor(id)   new moreap   moreap = (g_PlayerLevel[id]*20)   new setap = currentap + moreap   cs_set_user_armor(id, setap, CsArmorType:2)  }  /*if(g_PlayerClass[id] == CLASS_STAY)  {   new iHP, iAP   iHP = g_PlayerLevel[id]*25   iAP = g_PlayerLevel[id]*20     if(g_PlayerHP[id] < 100) g_PlayerHP = 100   if(g_PlayerAP[id] < 100) g_PlayerAP = 100     g_PlayerHP += iHP   g_PlayerAP += iAP     set_user_health(id, iHP)   cs_set_user_armor(id, iAP, CsArmorType:2)  }*/  if(g_PlayerClass[id] == CLASS_JUMP)  {   new lessgrav   new currentgrav   currentgrav = get_user_gravity(id)   lessgrav = (g_PlayerLevel[id]*0.15)   new iGrav   iGrav = currentgrav - lessgrav   set_user_gravity(id, iGrav)  } } //----------[ THE END ]----------
It is also posted as an attachment...
So help me if you can, it will be VERY appreciated!!




Thanks in advance,
TheLinx



Attached Files
File Type: sma Get Plugin or Get Source (amxx_tacticmod.sma - 966 views - 10.6 KB)

Last edited by TheLinx; 08-15-2006 at 06:02. Reason: Zenith77 couldnt find what i needed help with...
TheLinx is offline
Send a message via ICQ to TheLinx Send a message via AIM to TheLinx Send a message via MSN to TheLinx Send a message via Yahoo to TheLinx Send a message via Skype™ to TheLinx
 



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 23:05.


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