Quote:
Originally Posted by psychonic
What is the benefit?
|
It comes out in the user's own language.
As Asherkin
pointed out in another thread, this corresponds to the #GameUI_vote_failed_cannot_kick_admin in-game translation string.
-- MERGE --
Specifically, the code would look something like this (Note I was looking at the wrong usermessage earlier, which is why the arguments here are byte and short):
PHP Code:
new Handle:bf = StartMessageOne("CallVoteFailed", client, USERMSG_RELIABLE);
BfWriteByte(bf, 12);
BfWriteShort(bf, -1);
EndMessage();
The second argument is the time when the first argument is 2, otherwise it's ignored. However, all of Valve's internal functions set it to -1 when it's not used.
-- MERGE --
And
here is what it would look like in game, in English.
-- MERGE --
I haven't tested it, but in theory this should work.
Changelog:
- Updated version to 1.0a (I don't like changing major or minor version numbers in other peoples' plugins.)
- Modified it to send the CallVoteFailed usermessage with fail reason 12 rather than a PrintToChat message.
- Changed the spelling of psychonic's name to remove an extra n (it was spelled psychoninc in 1.0)
The SourceMod docs aren't clear if I needed to CloseHandle the BitBuffer handle or not, so I did just in case. If you get errors about invalid handles, it didn't, and this is why you're getting errors. Tell me and I'll fix it.