Raised This Month: $ Target: $400
 0% 

FM_AlertMessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
capndurk
Senior Member
Join Date: Feb 2006
Old 03-28-2006 , 00:03   FM_AlertMessage
Reply With Quote #1

I have this code:

Code:
register_forward(FM_AlertMessage, "eventSuicide")


I do want to block this message for the purpose of saving rank, but I'm having trouble with this:

Code:
public eventSuicide(at_type, message[]) {     if(containi(message, "suicide") != -1 && containi(message, "world") != -1)     {         if(g_switching[id] == true)         {             return FMRES_HANDLED         }     }         return PLUGIN_CONTINUE }


Basically, I have a global integer array that uses the 32 ids in the server, and I was wondering if there was a way to use at_type to gather that id from the function..?
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2006 , 00:05  
Reply With Quote #2

Why are you trying to capture suicide in that way?

We have a forward for suicide:
client_kill in engine

Also, there are other ways to capture damage and the like.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
capndurk
Senior Member
Join Date: Feb 2006
Old 03-28-2006 , 00:08  
Reply With Quote #3

This isn't for when a user types kill in the console, it's for when he switches teams using the chooseteam function. Does team-switching still execute kill on the player's console?
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2006 , 00:26  
Reply With Quote #4

Why is it called eventSuicide then?
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
capndurk
Senior Member
Join Date: Feb 2006
Old 03-28-2006 , 00:29  
Reply With Quote #5

Err... personal touch? Lol, I just thought it appropriate since it's an event and I'm trying to capture when it happens. I've seen "blocksuicide" also, maybe that would be better.
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-28-2006 , 00:44  
Reply With Quote #6

Removed.
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2006 , 01:02  
Reply With Quote #7

It isn't spam, it was an honest attempt to try ot understand your problem and help you with it. It wasn't a pointless question; I was trying to understand what it did.

Now then, I understand now you are catching when a client dies, and is killed by worldspawn, so you can figure out when they change teams. Makes...some sense. However, clients are killed by worldspawn due to fall damage too, so I didn't understand to start with.

However, to answer your question: Check to see what at_type is. It might be the id of the player. If not, try read_data. Its still a message, so it should be possible to get said information back, unless its simply a debug or log message, in which case, you may need to use some other method of getting when this occurs.

Unfortunately, I still don't understand why you are using AlertMessage for this. Why are you trying to block the message? I don't see why there is a reason to block it. Why not use one of the messages that goes with register_message? I'm sure there is one for changing teams, or some other method which doesn't have a loophole like this one?
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
capndurk
Senior Member
Join Date: Feb 2006
Old 03-28-2006 , 01:08  
Reply With Quote #8

My goal in all this is to protect a person's rank when he switches teams, as well as his score within the server (+showscores thing). In order to protect the person's rank, I have to retrieve the message before it's stored in csstats.dat or whatever that file is, and the only way to do that is to capture the suicide using Fakemeta (as far as I can see).

So, if the person is switching (g_switching[id]), then I return FMRES_SUPERCEDE in order to block the message, and that will stop it from saving to the .dat file. This integer array is what also separates the regular suicides from the team-switching suicides.

//Edit// I also do have a couple bugs in mind that need fixing, but I just wanted to get this part of the plugin finished first.


P.S. Thanks for the help.
__________________
I have left these forums because a certain respected member has been acting immaturely lately and has decided that I am not welcome in this community.
capndurk is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 03-28-2006 , 01:11  
Reply With Quote #9

capndurk: No, at_type doesnt return the id. It identifies the type of message.
Code:
at_notice,
	at_console,		// same as at_notice, but forces a ConPrintf, not a message box
	at_aiconsole,	// same as at_console, but only shown if developer level is 2!
	at_warning,
	at_error,
	at_logged		// Server print to console ( only in multiplayer games ).
And if your using this in CS then it should always be at_logged
Freecode is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-28-2006 , 01:12  
Reply With Quote #10

That won't work, modules get the information quicker. You'll need to tell the module, not try and prevent the module from getting the info.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Reply


Thread Tools
Display Modes

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 16:29.


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