Raised This Month: $ Target: $400
 0% 

Bad Load on plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zidd
Junior Member
Join Date: Dec 2004
Location: 66.199.236.61:27015
Old 04-04-2005 , 18:05   Bad Load on plugin
Reply With Quote #1

im getting a bad load on my plugin and i dont know whats wrong
Code:
//Vampire Mod //By Zidd //A Version Half-life engine version of an unreal tournament mutator #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init () {     register_plugin("Vampire Mode","0.01","Zidd")     register_clcmd("amx_vampire", "vampire",  ADMIN_LEVEL_A, " : Sets Vampire Mode")     register_event("deathmsg","deathmsge","a") } public vampire (id) {         new health=get_user_health( id ) // What Should Happen When You Reach 1 HP     if ( health == 1 ) {     client_print (1,print_center,"You Thirst For Blood Go Get Some Kills For More HP!")     return PLUGIN_HANDLED     } //What Should Happen When You Have More Than 1 HP     if (health < 1) {         set_user_health (id,(health -=1))         return PLUGIN_HANDLED       }     return PLUGIN_HANDLED } public deathmsge () {     new id = read_data( 1 ) ;     new health = get_user_health ( id )  ;     set_user_health ( id,(health += 10))     client_print(1,print_center,"Your Victims Blood Gets You 10 HP")     return PLUGIN_HANDLED }
Zidd is offline
Send a message via AIM to Zidd
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-04-2005 , 19:38  
Reply With Quote #2

Code:
register_event("DeathMsg", "deathmsge", "a")
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Zidd
Junior Member
Join Date: Dec 2004
Location: 66.199.236.61:27015
Old 04-04-2005 , 20:47  
Reply With Quote #3

i dont get a bad load anymore but the plugin dosent work can someone see whats wrong with the code? ive got all the modules enabled on the test server
Code:
//Vampire Mod //By Zidd //A Version Half-life engine version of an unreal tournament mutator #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init () {     register_plugin("Vampire Mode", "0.01", "Zidd")     register_clcmd("amx_vampire", "vampire",  ADMIN_LEVEL_A, " : Sets Vampire Mode")     register_event("deathmsg", "deathmsge", "a") } public vampire (id) {         new health=get_user_health( id ) // What Should Happen When You Reach 1 HP     if ( health == 1 ) {     client_print (1, print_center, "You Thirst For Blood Go Get Some Kills For More HP!")     return PLUGIN_HANDLED     } //What Should Happen When You Have More Than 1 HP     if (health < 1) {         set_user_health (id,(health -=1))         return PLUGIN_HANDLED       }     return PLUGIN_HANDLED } public deathmsge () {     new id = read_data( 1 ) ;     new health = get_user_health ( id )  ;     set_user_health ( id,(health += 10))     client_print (1, print_center, "Your Victims Blood Gets You 10 HP")     return PLUGIN_HANDLED }
Zidd is offline
Send a message via AIM to Zidd
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-04-2005 , 21:19  
Reply With Quote #4

I always thought that the Event names were Case-Sensitive, but I could be wrong..

Either way, you should change:
Code:
register_event("deathmsg", "deathmsge", "a") //to register_event("DeathMsg", "deathmsge", "a")


Anyway, apart from that, in your DeathMsg function:
Code:
new id = read_data( 1 ) ; // should be: new id = read_data( 2 ) ;

And, you are trying to give health back to the dead player, which isn't going to happen.. he is already dead.. You want to give health to the attacker who killed him, so you could try:
Code:
new iAttackerID = get_user_attacker( id )

Oh, and you should make sure that the victim and attacker are valid players:
Code:
if( !is_user_connected(id) )     return PLUGIN_CONTINUE

So overall, your DeathMsg function should look like:
Code:
public deathmsge () {     new id = read_data( 2 );     if( !is_user_connected(id) )         return PLUGIN_CONTINUE     new iAttackerID = get_user_attacker( id )     if( !is_user_connected(iAttackerID) )         return PLUGIN_CONTINUE     new health = get_user_health ( iAttackerID );     set_user_health ( iAttackerID, health + 10 )     client_print ( iAttackerID, print_center, "Your Victims Blood Gets You 10 HP")     // DONT return PLUGIN_HANDLED from hooked events!     return PLUGIN_CONTINUE }

Oh, and your vampire() function is completely useless as it is, and I don't know what you wanted to do with it, but it is logically messed up!! No offense..

Anyway, I hope that helps!
xeroblood is offline
Send a message via MSN to xeroblood
Zidd
Junior Member
Join Date: Dec 2004
Location: 66.199.236.61:27015
Old 04-05-2005 , 18:29  
Reply With Quote #5

the point of the vampire function was to make peoples health continuoulsly go down til they reach 1 hp then it would stop and say something that was the point of it i dont know if i did it right tho
Zidd is offline
Send a message via AIM to Zidd
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 09:56.


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