AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   UserMsg not present? (https://forums.alliedmods.net/showthread.php?t=20142)

Zenith77 11-02-2005 13:43

UserMsg not present?
 
ok this error:
Code:

Host_Error: UserMsg: Not Present on Client 2

comes up for this

Code:
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)// TE_BEAMFOLLOW ( msg #22) create a line of decaying beam segments until entity stops moving     write_byte(22)          // msg id     write_short(ePlasmaBall)        // short (entity:attachment to follow)     write_short(gTrailModel)    // short (sprite index)     write_short(20)         // byte (life in 0.1's)  ( length )     write_short(8)          // byte (line width in 0.1's)     write_byte(42)          // byte (color) red     write_byte(170)         // byte (color) green     write_byte(255)         // byte (color) blue     write_byte(50)          // byte (brightness)     message_end()


in this function

Code:
public cmdShoot(id)  {     new origin[3], Float:fOrigin[3]     new Float:velocity[3]         get_user_origin(id,origin,1)     IVecFVec(origin, fOrigin)     new ePlasmaBall = create_entity("info_target")     entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")     new Float:posAdjust[3] //Used for adjusting the starting position     velocity_by_aim(id, 70, posAdjust)  //You can replace 50 with whatever     fOrigin[0] += posAdjust[0]     fOrigin[1] += posAdjust[1]     fOrigin[2] += posAdjust[2]     entity_set_vector(ePlasmaBall, EV_VEC_origin, fOrigin)     entity_set_vector(ePlasmaBall, EV_VEC_origin,fOrigin)     new Float:maxs[3] = {0.2,0.2,0.5}     new Float:mins[3] = {-0.2,-0.2,-0.5}     entity_set_size(ePlasmaBall,mins,maxs)     entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)     entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_FLYMISSILE)         entity_set_float(ePlasmaBall,EV_FL_framerate,1.0)         entity_set_int(ePlasmaBall, EV_INT_rendermode, 5)         entity_set_float(ePlasmaBall, EV_FL_renderamt, 255.0)         entity_set_float(ePlasmaBall, EV_FL_scale, 1.20)     entity_set_model(ePlasmaBall, "sprites/plasma.spr")         emit_sound(ePlasmaBall, CHAN_AUTO, "misc/plasma_shoot.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)         VelocityByAim(id,200,velocity)     entity_set_vector(ePlasmaBall,EV_VEC_velocity,velocity)         entity_set_edict(ePlasmaBall, EV_ENT_owner, id)         // Create a trail...                /* Broadcast to all players*/            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)// TE_BEAMFOLLOW ( msg #22) create a line of decaying beam segments until entity stops moving     write_byte(22)          // msg id     write_short(ePlasmaBall)        // short (entity:attachment to follow)     write_short(gTrailModel)    // short (sprite index)     write_short(20)         // byte (life in 0.1's)  ( length )     write_short(8)          // byte (line width in 0.1's)     write_byte(42)          // byte (color) red     write_byte(170)         // byte (color) green     write_byte(255)         // byte (color) blue     write_byte(50)          // byte (brightness)     message_end()           // msg complete                              }

And i have no clue why...

I thought maybe setting the owner as id would solve it but i guess not :/


thnx for all your help :)

--Zenith77

haimmaik 11-02-2005 14:51

[b4 the edit]
*all bullshit*

[edit]:
related to ur comments
Code:

write_short(20)        // byte (life in 0.1's)  ( length )
write_short(8)        // byte (line width in 0.1's)

u used write_short... and u wrote its byte.. maybe try write byte...
Code:

write_byte(20)  // byte (life in 0.1's) 
write_byte(8)    // byte (line width in 0.1's)

OMG ITS SO BEAUTIFUL!!!!
DUDE!! UR THE MAN!!!

(and this is how u solv problem without any idea of this entity thing ^^)

XxAvalanchexX 11-02-2005 18:10

Basically what he was trying to say is after the first two shorts the rest of the data should be sent in bytes.

haimmaik 11-02-2005 18:17

no actually.. i was trying to slove it myself... and i just wrote the log here :)

cTn 11-02-2005 19:02

Zenith77 what a hell u trying to made? :DD

haimmaik 11-02-2005 19:05

a Plasma gun... i asked him how.. and he helped me :)

Batman/Gorlag 11-03-2005 01:16

Right, I also helped but keep giving credits to Zenith and no credit to me at all. Just keep doing that.

haimmaik 11-03-2005 07:44

i didnt finish it..... ull b in the credits
here i just answered some1's question.


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

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