FM_AlertMessage
I have this code:
Code:
I do want to block this message for the purpose of saving rank, but I'm having trouble with this: Code:
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..? |
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. |
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?
|
Why is it called eventSuicide then?
|
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.
|
Removed.
|
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? |
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. |
capndurk: No, at_type doesnt return the id. It identifies the type of message.
Code:
at_notice, |
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.
|
| All times are GMT -4. The time now is 16:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.