AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MSG Help... (https://forums.alliedmods.net/showthread.php?t=20032)

Zenith77 10-30-2005 19:11

MSG Help...
 
This comes up :

Code:


L 10/30/2005 - 18:08:30: [AMXX] Plugin called message_begin with an invalid message id (0).
L 10/30/2005 - 18:08:30: [AMXX] Displaying debug trace (plugin "GAIO.amxx")
L 10/30/2005 - 18:08:30: [AMXX] Run time error 10: native error (native "message_begin")
L 10/30/2005 - 18:08:31: [AMXX]    [0] GAIO.sma::cmdHudPink (line 1

for this...

Code:
message_begin(MSG_ONE, g_msgFade, {0,0,0}, id) write_short(1<<0)   // fade lasts this long duration write_short(1<<0)   // fade lasts this long hold time write_short(1<<2)   // fade type HOLD write_byte(iRed)    // fade red write_byte(iGreen)  // fade green write_byte(iBlue)   // fade blue write_byte(100)     // fade alpha message_end()

I know id is a player, or else i wouldnt be in the game :/ .....


So could anybody point me to the problem ?

Thank you,

--Zenith77

Charr 10-30-2005 19:26

Did you get the ID of the message?

Zenith77 10-30-2005 19:30

Yeppers..

Code:
g_msgFade = get_user_msgid("ScreenFade")

Charr 10-30-2005 19:33

Check if screenfade is in your mod, case the error looks like theres no screenfade.

Zenith77 10-30-2005 19:36

its in there.....

its in everymod :P


not only that...


without screen fade there would be no flash in CS. ...

Proof:


Quote:

Originally Posted by MetaMod
ScreenFade 98 10


SSJ2GOKU 10-30-2005 20:05

this one works for meh

Code:
new gmsgFade message_begin(MSG_ONE, gmsgFade, {0,0,0}, user) write_short(1<<12) // fade lasts this long duration   write_short(1<<8) // fade lasts this long hold time   write_short(1<<0) // fade type IN write_byte(0) // fade red   write_byte(0) // fade green   write_byte(0) // fade blue     write_byte(255) // fade alpha     message_end()

Zenith77 10-30-2005 20:36

i dont see the diff.

XxAvalanchexX 10-30-2005 20:56

Where do you get the message's id? Is the user you are sending this to connected?

Zenith77 10-30-2005 21:03

Quote:

Originally Posted by Zenith77
I know id is a player, or else i wouldnt be in the game :/ .....


This is one of the functions ( all the others are the same, just modified to produce diff results... )



Code:
public cmdHudPurple(id) {         if( !get_cvar_num("sv_glow") ) {                 client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")                 return PLUGIN_HANDLED     }                 if( g_GlowHudColor[id] == GLOW_PURPLE) {                 client_print(id, print_chat, "[AMXX] You are already have a purple hud!" )                 return PLUGIN_HANDLED     }         client_print(id, print_chat, "[AMXX] Your hud is now purple!" )             message_begin(MSG_ONE, g_msgFade, {0,0,0}, id)     write_short(1<<0)   // fade lasts this long duration     write_short(1<<0)   // fade lasts this long hold time     write_short(1<<2)   // fade type HOLD     write_byte(170)     // fade red     write_byte(0)       // fade green     write_byte(128)     // fade blue     write_byte(100)     // fade alpha     message_end()         g_GlowHudColor[id] = GLOW_PURPLE         g_GlowHudCustomColor[id][0] = 170     g_GlowHudCustomColor[id][1] = 0     g_GlowHudCustomColor[id][2] = 128                 return PLUGIN_HANDLED     }

XxAvalanchexX 10-30-2005 21:53

Where is g_msgFade assigned a value?


All times are GMT -4. The time now is 23:49.

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