Raised This Month: $ Target: $400
 0% 

Usermessages, bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StSatan
Senior Member
Join Date: Apr 2010
Old 11-15-2015 , 13:01   Usermessages, bug?
Reply With Quote #1

I have a problem with send fade messsage in the following situation:

Code:
HookEvent("player_death", EventPlayerDeathPost)

Code:
public EventPlayerDeathPost(Handle event, const char[] name, bool dontBroadcast) {     int attacker     if((attacker = GetClientOfUserId(GetEventInt(event, "attacker"))))     {         PrintToConsole(attacker, "%i", attacker) // here is right ID = 1         int receiver[1]         receiver[0] = attacker         Handle message = StartMessage("Fade", receiver, USERMSG_RELIABLE) // but here receiver[0] equals 51808 and sourcemod throws error that client id is invalid (51808)         PbSetInt(message, "duration", 10000)         PbSetInt(message, "hold_time", 0)         PbSetInt(message, "flags", 0x0001)         PbSetColor(message, "clr", { 255, 255, 255, 255 })         EndMessage()     } }

whats wrong with sourcemod or its me?

Last edited by StSatan; 11-15-2015 at 13:20.
StSatan is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 11-15-2015 , 13:35   Re: Usermessages, bug?
Reply With Quote #2

think you want StartMessageOne instead of StartMessage
Miu is offline
StSatan
Senior Member
Join Date: Apr 2010
Old 11-15-2015 , 13:36   Re: Usermessages, bug?
Reply With Quote #3

oh, I just saw that there is an additional parameter...
StSatan is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 11-15-2015 , 17:03   Re: Usermessages, bug?
Reply With Quote #4

I think this will solve problem.
PHP Code:
Handle message StartMessage("Fade"receiver1USERMSG_RELIABLE

Last edited by Kailo; 11-15-2015 at 17:03.
Kailo 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 16:25.


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