View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-20-2011 , 12:13  
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
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"clientUSERMSG_RELIABLE);
BfWriteByte(bf12);
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.
Attached Files
File Type: sp Get Plugin or Get Source (tf_kickvote_immunity.sp - 1266 views - 2.9 KB)
__________________
Not currently working on SourceMod plugin development.

Last edited by asherkin; 07-20-2011 at 12:30.
Powerlord is offline