Raised This Month: $ Target: $400
 0% 

Damage Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cronck
Member
Join Date: Apr 2005
Old 04-21-2005 , 20:58   Damage Event
Reply With Quote #1

I've tried this, but cant get it to work...

Code:
new PLUGIN[]="Test Script" new AUTHOR[]="Cronck" new VERSION[]="1.00" new iSilentPlayer[32] new iPlayerDamage[32][3] new sPlayerName[32] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_event( "Damage", "Event_Damage", "b") } public event_Damage(id) {     client_print(id, print_chat, "Testing.....") }

If you can, make it show damage dealth after Testing.....
Cronck is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-21-2005 , 21:01  
Reply With Quote #2

You have a type-o:

Code:
register_event( "...", "Event_Damage", "...") // [...] public event_Damage(id) { //... }

Notice the capital 'E' when you registered the command...
xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 04-21-2005 , 21:03  
Reply With Quote #3

Im new to this, and i dont get what you're talking about...

EDIT
Now i get it.... It's case sensitive?
Cronck is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-21-2005 , 21:04   Re: Damage Event
Reply With Quote #4

Also, a little more checking could be done:
Code:
// [...] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_event( "Damage", "Event_Damage", "b", "2!0" ) } public Event_Damage(id) {     if( !is_user_connected(id) )         return PLUGIN_CONTINUE     client_print(id, print_chat, "Testing.....")     return PLUGIN_CONTINUE }

Edit: Yes, Case Sensitive!
xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 04-21-2005 , 21:06  
Reply With Quote #5

Yea... I know i could check more stuff... This is just very simple, because i've tried so damn many times to make to react on this event
Cronck is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-21-2005 , 21:30  
Reply With Quote #6

lol, yup case sensitivity is a real bitch.. I remember moving from VB which was not only not case sensitive, but auto corrected case to a case sensitive language (first one was java); it was horrible, especially because i would name my vars like this MyVar1 and then type it in code like this myvar1 and it would fix the case for me, and if it didn't then i knew i spelled it wrong. Bad, bad habit. Anyways, always check your spelling and case first if a var isn't working right!
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
Cronck
Member
Join Date: Apr 2005
Old 04-22-2005 , 13:50  
Reply With Quote #7

Lmao... I just moved from VB 6 too
Cronck is offline
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:53.


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