Hi connorr thanks for the reply, I tried that and it doesnt work, still same problem. Each client is kicked and message in console reads
Quote:
|
Host_Error: CL_ParseServerMessage: Bad server messag
|
Code is exactly:
PHP Code:
//These are global
new gmsgShake = get_user_msgid ( "ScreenShake" );
new eq_Sprite = precache_model ( "sprites/shockwave.spr" );
public EarthQuake_DO( parm[] )
{
new enemy = parm[0]; //original enemy targeted
new id = parm[2]; //caster of the earthquake
//Get the origin of the original enemy cast to use as basis for radius
new origin[3];
get_user_origin( enemy, origin );
//Do a ground shockwave
message_begin ( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte ( TE_IMPLOSION );
write_coord ( origin[0] + random_num ( -100, 100 ) );
write_coord ( origin[1] + random_num ( -100, 100 ) );
write_coord ( origin[2] + random_num ( -50, 50 ) );
write_short ( eq_Sprite );
write_byte ( random_num ( 0,20 ) + 20 );
write_byte ( 12 );
write_byte ( TE_EXPLFLAG_NONE );
message_end ( );
new players[32], targetorigin[3], numberofplayers, i, distancebetween, damage = 45;
get_players ( players, numberofplayers );
for ( i = 0; i < numberofplayers; ++i )
{
get_user_origin ( players[i], targetorigin );
distancebetween = get_distance ( origin, targetorigin );
if ( ( distancebetween < 300 ) && is_user_alive ( players[i] ) )
{
//Deal damage
do_damage ( players[i], id, damage, 26, 3, 0, 0, 0 );
//Shake the users screen
message_begin( MSG_ONE, gmsgShake, { 0, 0, 0 }, players[i] );
write_short( 255<< 14 ); //ammount
write_short( 10 << 14 ); //lasts this long
write_short( 255<< 14 ); //frequency
message_end( );
}
}
So apparently I am doing something wrong, I dont even know if thats teh right model/sprite to use to accomplish an earthquake effect, but even if its not it doesnt work at all