Raised This Month: $ Target: $400
 0% 

Plugin is running but dont see a trace of it


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-26-2006 , 13:21   Plugin is running but dont see a trace of it
Reply With Quote #1

EDIT:

This problem is solved! +karma for the guys that helped me!
But, i got another problem
Help me in this thread:
http://forums.alliedmods.net/showthread.php?t=42109

:ENDEDIT


Hello!

I need some help with an mod that i have made.
I used this tutorial: http://forums.alliedmods.net/showthread.php?t=12518
I just edited it to an my mod. In game it says that my plugin is running. But when i try to use the commands, it doesnt happen anything (Because of the turn on/off cvar) Can someone help he with this? i post the code so can tell me whats wrong:

Code:
/********************************
----------TacticMod--------------
---Author:
TheLinx
---Credits:
XunTric
---Changelog:
--1.0
The plugin is born! Its just one thing, YOU JUST GET XP! DOH!
 
********************************/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <vault>
#define CLASS_NOTHING 0
#define CLASS_RUN 1
#define CLASS_SHOOT 2
#define CLASS_JUMP 3
#define CLASS_DIE 4
#define MAXCLASSES 5
new PlayerClass[33]
new PlayerXP[33]
new PlayerLevel[33]
new const CLASSES[MAXCLASSES][] = {
    "None",
    "Run for your life!",
    "Shoot him! SHOOT HIM!",
    "Jump to safety!",
    "Make suicide"
}
new msgtext
new const LEVELS[5] = {
    100, //100 XP for level 1
    200, //200 XP for level 2
    400, //Etc..
    800,
    1600,
}
public plugin_init()
{
    register_plugin("Choose tactic mod", "1.0", "TheLinx")
    register_cvar("tmod_onoroff", "1")
 
    register_event("DeathMsg", "DeathMsg", "a") 
 
    register_cvar("xp_per_kill", "10")
    register_cvar("SaveXP", "1")
 
    register_menucmd(register_menuid("menu_ChooseTactic"),1023,"DoChooseTactic"); 
 
    register_event("ResetHUD", "ResetHud", "b")
 
    msgtext = get_user_msgid("StatusText") 
    register_clcmd("say /changetactic", "ChangeTactic")
    register_clcmd("say_team /changetactic", "ChangeTactic")
    register_clcmd("say /tacticmenu", "menu_ChooseTactic")
}
public SaveXP(id)
{
    new authid[32]; 
    get_user_authid(id,authid,31); 
    new vaultkey[64], vaultdata[64]; 
 
    //Save their class
    format(vaultkey,63,"TACTICMOD-%s-class",authid); 
    format(vaultdata,63,"%d",PlayerClass[id]); 
    set_vaultdata(vaultkey,vaultdata); 
    //Save their XP
    format(vaultkey,63,"TACTICMOD-%s-xp",authid); 
    format(vaultdata,63,"%d",PlayerXP[id]); 
    set_vaultdata(vaultkey,vaultdata); 
    //Save their level
    format(vaultkey,63,"TACTICMOD-%s-level",authid); 
    format(vaultdata,63,"%d",PlayerLevel[id]); 
    set_vaultdata(vaultkey,vaultdata);
} 
 
public LoadXP(id)
{
    new authid[32]; 
    get_user_authid(id,authid,31); 
    new vaultkey[64], vaultdata[64]; 
    //Load their class
    format(vaultkey,63,"TACTICMOD-%s-class",authid); 
    get_vaultdata(vaultkey,vaultdata,63); 
    PlayerClass[id] = str_to_num(vaultdata); 
     //Load their XP
    format(vaultkey,63,"TACTICMOD-%s-xp",authid); 
    get_vaultdata(vaultkey,vaultdata,63); 
    PlayerXP[id] = str_to_num(vaultdata);   
    //Load their level
    format(vaultkey,63,"TACTICMOD-%s-level",authid); 
    get_vaultdata(vaultkey,vaultdata,63);
    PlayerLevel[id] = str_to_num(vaultdata);  
} 
 
 
public client_connect(id)
{
    if(get_cvar_num("SaveXP") == 1) {
 
         LoadXP(id)
         //Add a message if you want....
         client_print(id, print_chat, "[Choose Tactic Mod] XP Loaded!")
         client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is %s with level %s and %s XP", PlayerClass[id], PlayerLevel[id], PlayerXP[id])
    }
}
public client_disconnect(id)
{
    if(get_cvar_num("SaveXP") == 1) {
 
         SaveXP(id)
    }
}
 
stock ChooseTactic(id)
{
    new menu[192] 
 
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3 
    format(menu, 191, "Choose Tactic Mod: Choose Tactic^n^n1. Run for your life!^n2. Shoot him! SHOOT HIM!!^n3. Jump to safety...^n4. Make suicide.^n^n0. Exit") 
 
    //We created a menu in plugin_init() and now we make the plugin know that its this menu it has to show.
    show_menu(id, keys, menu, -1, "menu_ChooseTactic") 
 
    return PLUGIN_CONTINUE
}
public DoChooseTactic(id, key)
{
    if(key == 0) {
 
         if(PlayerClass[id] == CLASS_RUN) {
 
              client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is already to Run for your life! Choose something else!")
 
              ChooseTactic(id)
 
              return PLUGIN_HANDLED
         }        
         PlayerClass[id] = CLASS_RUN
 
         client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is now to Run for your life!")
    }        
 
    if(key == 1) {
 
         if(PlayerClass[id] == CLASS_SHOOT) {
 
              client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is already to Shoot him! SHOOT HIM! Choose something else!")
              ChooseTactic(id)
              return PLUGIN_HANDLED
         }
 
         PlayerClass[id] = CLASS_SHOOT
         client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is now to Shoot him! SHOOT HIM!")
    }
 
    if(key == 2) {
 
         if(PlayerClass[id] == CLASS_JUMP) {
 
              client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is already to Jump to safety... Choose something else!")
              ChooseTactic(id)
              return PLUGIN_HANDLED
         }
 
         PlayerClass[id] = CLASS_JUMP
         client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is now to Jump to safety...")
    }    
    if(key == 3) {
 
         if(PlayerClass[id] == CLASS_DIE) {
 
              client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is already to Make suicide. Choose something else!")
              ChooseTactic(id)
              return PLUGIN_HANDLED
         }
 
         PlayerClass[id] = CLASS_DIE
         client_print(id, print_chat, "[Choose Tactic Mod] You´re tactic is now to Make suicide.")
    }
 
    ShowHUD(id)
 
    return PLUGIN_HANDLED
}
public ResetHUD(id)
{
    if(get_cvar_num("tmod_onoroff") == 0) {
         return PLUGIN_HANDLED
    }
    if(PlayerClass[id] == CLASS_NOTHING) {
 
         ChooseTactic(id)
         return PLUGIN_HANDLED
    }
 
    return PLUGIN_HANDLED
}
public DeathMsg()
{
    if(get_cvar_num("tmod_onoroff") == 0) {
         return PLUGIN_HANDLED
    }
 
    new attacker = read_data(1)
 
    if(PlayerClass[attacker] == CLASS_NOTHING) {
         return PLUGIN_HANDLED
    }
 
    if(PlayerLevel[attacker] == 5) {
         return PLUGIN_HANDLED
    }
 
    PlayerXP[attacker] += get_cvar_num("XP_per_kill")
 
    if(PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]]) {
 
         PlayerLevel[attacker] += 1
 
         client_print(attacker, print_chat, "[Choose Tactic Mod] Congratulations! You leveled up! You´re new level is %i!", PlayerLevel[attacker])
 
         if(get_cvar_num("SaveXP") == 1) {
 
              SaveXP(attacker)
         }
         ShowHUD(attacker)
    }   
 
    ShowHUD(attacker)
 
    return PLUGIN_CONTINUE
}
public ShowHUD(id)    
{ 
    new HUD[51] 
 
    format(HUD, 50, "[%s]Level: %i XP: %i", CLASSES[PlayerClass[id]], PlayerLevel[id], PlayerXP[id]) 
    message_begin(MSG_ONE, msgtext, {0,0,0}, id) 
    write_byte(0) 
    write_string(HUD) 
    message_end() 
    return
}
PLZ dont steal this mod idea!
PLZ dont tell me to
PLZ help me!
It will be very appreciated!!

Thanks in advance,

TheLinx

Last edited by TheLinx; 07-27-2006 at 07:13.
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
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-26-2006 , 16:18   Re: Plugin is running but dont see a trace of it
Reply With Quote #2

Can someone plz help me O.O
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
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-26-2006 , 18:06   Re: Plugin is running but dont see a trace of it
Reply With Quote #3

You should be checking your logs for errors. If there are certain errors then the plugin won't run propertly.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 07-26-2006 , 20:46   Re: Plugin is running but dont see a trace of it
Reply With Quote #4

Just check the logs (in your amxmodx/logs folder) and see if errors are inside.......
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-27-2006 , 05:27   Re: Plugin is running but dont see a trace of it
Reply With Quote #5

Its a errorlog and it says:

L 07/26/2006 - 18:50:10: Function "ResetHud" was not found
L 07/26/2006 - 18:50:10: [AMXX] Run time error 19 (plugin "amxx_tacticmod.amxx") - debug not enabled!
L 07/26/2006 - 18:50:10: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 07/26/2006 - 18:57:09: Function "ResetHud" was not found
L 07/26/2006 - 18:57:09: [AMXX] Run time error 19 (plugin "amxx_tacticmod.amxx") - debug not enabled!
L 07/26/2006 - 18:57:09: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 07/26/2006 - 193:25: Function "ResetHud" was not found
L 07/26/2006 - 193:25: [AMXX] Run time error 19 (plugin "amxx_tacticmod.amxx") - debug not enabled!
L 07/26/2006 - 193:25: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Whats the wrong? Im going to check if i got the same problem as the other guy...
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
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-27-2006 , 05:33   Re: Plugin is running but dont see a trace of it
Reply With Quote #6

Nope...

Line 67: register_event("ResetHUD", "ResetHud", "b")

Line 221: public ResetHUD(id)

whats the wrong? :'(
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
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-27-2006 , 05:43   Re: Plugin is running but dont see a trace of it
Reply With Quote #7

i used debug on the plugin and it said:

L 07/27/2006 - 11:470: Function "ResetHud" was not found
L 07/27/2006 - 11:470: [AMXX] Displaying debug trace (plugin "amxx_tacticmod.amxx")
L 07/27/2006 - 11:470: [AMXX] Run time error 19: function not found
L 07/27/2006 - 11:470: [AMXX] [0] amxx_tacticmod.sma::plugin_init (line 67)

i need some urgent help...
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
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 07-27-2006 , 05:52   Re: Plugin is running but dont see a trace of it
Reply With Quote #8

w00t found out the problem...

Line 67: register_event("ResetHUD", "ResetHud", "b")

should be

Line 67: register_event("ResetHUD", "ResetHUD", "b")

capital letters makes BIG difference XD
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
Reply



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