AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damage Event (https://forums.alliedmods.net/showthread.php?t=12696)

Cronck 04-21-2005 20:58

Damage Event
 
I've tried this, but cant get it to work... :oops:

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.....

xeroblood 04-21-2005 21:01

You have a type-o:

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

Notice the capital 'E' when you registered the command...

Cronck 04-21-2005 21:03

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

EDIT
Now i get it.... It's case sensitive? :D

xeroblood 04-21-2005 21:04

Re: Damage Event
 
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!

Cronck 04-21-2005 21:06

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 :lol:

BioHazardousWaste 04-21-2005 21:30

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!

Cronck 04-22-2005 13:50

Lmao... I just moved from VB 6 too :D


All times are GMT -4. The time now is 09:53.

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