Raised This Month: $ Target: $400
 0% 

Catching index of an event.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Santaaa
BANNED
Join Date: May 2012
Old 07-12-2012 , 11:07   Catching index of an event.
Reply With Quote #1

Hello there, im trying to catch the index of the player who used it of this event.

PHP Code:
register_event("23""Cmdspray""a""1=112"
I thought it was read_data(2), and im sure it is. I used it on my other plugins too, but it isnt working now.

Even tryed a loop to give it +1 for everyone, even that didnt work. LOL

Last edited by Santaaa; 07-12-2012 at 11:13.
Santaaa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-12-2012 , 11:26   Re: Catching index of an event.
Reply With Quote #2

Show the callback function you are using.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-12-2012 , 11:35   Re: Catching index of an event.
Reply With Quote #3

This is what I used.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "Spray counter"
#define VERSION "1.0"
#define AUTHOR "Santa"

new Sprays[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("23""Cmdspray""a""1=112")  
}

public 
Cmdspray()
{
    new 
id read_data(2)
    
    
Sprays[id]++

Santaaa is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-12-2012 , 11:37   Re: Catching index of an event.
Reply With Quote #4

Add a debug.
Code:
log_amx("Sprayer ID: %d", id);
hleV is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-12-2012 , 12:12   Re: Catching index of an event.
Reply With Quote #5

Nothing wrong.
Santaaa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-12-2012 , 12:14   Re: Catching index of an event.
Reply With Quote #6

Quote:
Originally Posted by Santaaa View Post
Nothing wrong.
What does the debug show?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-12-2012 , 12:33   Re: Catching index of an event.
Reply With Quote #7

When I do this in an apart plugin it works, but if I add it in my other plugin it doesnt work, im using the same code btw.
Santaaa is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-12-2012 , 13:25   Re: Catching index of an event.
Reply With Quote #8

Then maybe there is a missing function that stops the execution of plugin_init and the code below that line. Check for runtime errors.
__________________

Last edited by <VeCo>; 07-12-2012 at 13:26.
<VeCo> is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-12-2012 , 14:08   Re: Catching index of an event.
Reply With Quote #9

Quote:
Originally Posted by Santaaa View Post
When I do this in an apart plugin it works, but if I add it in my other plugin it doesnt work, im using the same code btw.
Show the full plugin where it breaks.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-12-2012 , 15:22   Re: Catching index of an event.
Reply With Quote #10

Well, I dont know what the problem was but I rewrote my plugin and its just fixed. Maybe because i've been using old include files? can that be the issue? because I upgraded my AMXX right now and it worked.
Santaaa 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 15:23.


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