Member
|
12-31-2018
, 04:40
Re: fattal error pf_message_begin
|
#11
|
guys i still need help
defines:
Code:
new gmsgStatusText, gmsgSayText, gmsgScreenFade, gmsgScreenShake, g_iMsgSayText
plugin_init
Code:
register_event("ScreenFade","ev_Flash","b","4=255","5=255","6=255","7>199")
gmsgSayText = get_user_msgid("SayText")
gmsgStatusText = get_user_msgid("StatusText");
gmsgScreenFade = get_user_msgid("ScreenFade");
gmsgScreenShake = get_user_msgid ("ScreenShake")
gmsgShake = get_user_msgid("ScreenShake")
g_iMsgSayText = get_user_msgid("SayText")
all functions with mesage_begin..
Code:
print_color(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()
// Send to everyone
if (!target)
{
static player
for (player = 1; player <= g_MaxPlayers; player++)
{
if (!g_isconnected[player])
continue;
static changed[5], changedcount
changedcount = 0
for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player)
changed[changedcount] = i
changedcount++
}
}
vformat(buffer, charsmax(buffer), message, 3)
message_begin(MSG_ONE_UNRELIABLE, gmsgSayText, _, player)
write_byte(player)
write_string(buffer)
message_end();
for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER)
}
}
// Send to specific target
else
{
vformat(buffer, charsmax(buffer), message, 3)
message_begin(MSG_ONE, gmsgSayText, _, target)
write_byte(target)
write_string(buffer)
message_end();
}
}
Code:
public ScreenFade_Item(id)
{
new players[32], num
get_players(players, num);
for(--num; num>=0; num--)
{
//message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id);
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, players[num]);
write_short(4096*10); // Duration
write_short(4); // Hold time 4096*2
write_short(4096); // Fade type
write_byte(0); // Red
write_byte(0); // Green
write_byte(255); // Blue
write_byte(80); // Alpha
message_end();
}
return PLUGIN_HANDLED
}
Code:
public ScreenFade_Stat(id)
{
new players[32], num
get_players(players, num);
for(--num; num>=0; num--)
{
//message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id);
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, players[num]);
write_short(4096*10); // Duration
write_short(4); // Hold time 4096*2
write_short(4096); // Fade type
write_byte(255); // Red
write_byte(255); // Green
write_byte(0); // Blue
write_byte(80); // Alpha
message_end();
}
return PLUGIN_HANDLED
}
Code:
public ScreenFade_Zariche(id)
{
new players[32], num
//get_players(players, num, "ace", "CT")
get_players(players, num);
new shakeAmplitude = __FixedUnsigned16(SHAKE_AMPLITUDE, 1<<12)
new shakeDuration = __FixedUnsigned16(SHAKE_DURATION, 1<<12)
new shakeFrequency = __FixedUnsigned16(SHAKE_FREQUENCY, 1<<9)
for(--num; num>=0; num--)
{
message_begin(MSG_ONE, gmsgShake, .player = players[num])
write_short( shakeAmplitude ) // shake amount.
write_short( shakeDuration ) // shake lasts this long.
write_short( shakeFrequency ) // shake noise frequency.
message_end();
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, players[num]);
write_short(4096*10); // Duration
write_short(4); // Hold time 4096*2
write_short(4096); // Fade type
write_byte(0); // Red
write_byte(0); // Green
write_byte(0); // Blue
write_byte(255); // Alpha
message_end();
}
return PLUGIN_HANDLED
}
Code:
public ScreenFade_Apokalypsa(id)
{
new players[32], num
get_players(players, num);
new shakeAmplitude = __FixedUnsigned16(SHAKE_AMPLITUDE, 1<<12)
new shakeDuration = __FixedUnsigned16(SHAKE_DURATION, 1<<12)
new shakeFrequency = __FixedUnsigned16(SHAKE_FREQUENCY, 1<<8)
for(--num; num>=0; num--)
{
message_begin(MSG_ONE_UNRELIABLE, gmsgShake, .player = players[num])
write_short( shakeAmplitude ); // shake amount.
write_short( shakeDuration ); // shake lasts this long.
write_short( shakeFrequency ); // shake noise frequency.
message_end();
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, players[num]);
write_short(4096*10); // Duration
write_short(4); // Hold time 4096*2
write_short(4096); // Fade type
write_byte(0); // Red
write_byte(0); // Green
write_byte(0); // Blue
write_byte(255); // Alpha
message_end();
}
return PLUGIN_HANDLED;
}
Code:
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
Code:
stock color_chat( const id, const szStr[], any:... )
{
new szMsg[ 191 ], iPlayers[ 32 ], iCount = 1;
vformat( szMsg, sizeof szMsg - 1, szStr, 3)
replace_all( szMsg, 190, "!g", "^4" )
replace_all( szMsg, 190, "!y", "^1" )
replace_all( szMsg, 190, "!t", "^3" )
if( id )
iPlayers[ 0 ] = id;
else get_players( iPlayers, iCount, "ch" )
for( new i = 0 ; i < iCount ; i++ )
{
if( is_user_connected( iPlayers[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] )
write_byte( iPlayers[ i ] )
write_string( szMsg )
message_end();
}
}
}
Code:
public effects(id) {
set_hudmessage(255,150,50, -1.0, 0.65, 0, 6.0, 1.5,0.1,0.7) // HUDMESSAGE
show_hudmessage(id,"Bol si odseknuty") // HUDMESSAGE
message_begin(MSG_ONE_UNRELIABLE,105,{0,0,0},id )
write_short(1<<10) // fade lasts this long duration
write_short(1<<10) // fade lasts this long hold time
write_short(1<<1) // fade type (in / out)
write_byte(20) // fade red
write_byte(255) // fade green
write_byte(255) // fade blue
write_byte(255) // fade alpha
message_end();
client_cmd(id,"spk fvox/blip.wav")
}
Code:
public ev_Flash(id)
{
if (!g_iszombie[id])
{
message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, id)
write_short(1)
write_short(1)
write_short(1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end();
}
else if (g_iszombie[id])
{
client_cmd(id, "mp3 play sound/%s", g_Concussion)
new Float:fadetime = 5.0, fade
fade = clamp(floatround(fadetime * float(1<<12)), 0, 0xFFFF);
g_isconcussioned[id] = true
set_task(fadetime, "Remove_Conc_Effects", CONCUSSION_TASK+id)
message_begin(MSG_ONE,gmsgScreenFade,{0,0,0},id)
write_short( fade )
write_short( 1<<10 )
write_short( 1<<12 )
write_byte( 255 )
write_byte( 255 )
write_byte( 255 )
write_byte( 200 )
message_end();
new Float:fVec[3];
fVec[0] = random_float(PA_LOW , PA_HIGH);
fVec[1] = random_float(PA_LOW , PA_HIGH);
fVec[2] = random_float(PA_LOW , PA_HIGH);
entity_set_vector(id , EV_VEC_punchangle , fVec);
message_begin(MSG_ONE , gmsgScreenShake , {0,0,0} ,id)
write_short( 1<<14 );
write_short( fade );
write_short( 1<<14 );
message_end();
}
}
|
|