AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error: "New message started when msg '23' has not been sent yet" (https://forums.alliedmods.net/showthread.php?t=206116)

Spy123 01-18-2013 16:19

Error: "New message started when msg '23' has not been sent yet"
 
I tried to edit something in soccerjam, but when I score server breaks and get this error: "New message started when msg '23' has not been sent yet"

I found this topic, but there the player doesn't know where it comes error (https://forums.alliedmods.net/showth...67393)..well,I know where the error comes..this is the code:
PHP Code:

new explosion[TEAMS

public 
plugin_precache() {
    
precache_model(ball)
    
    
spr_beam     =     precache_model("sprites/beam14.spr")
    
spr_fire     =     precache_model("sprites/shockwave.spr")
    
spr_smoke     =     precache_model("sprites/steam1.spr")
    
spr_fxbeam     =     precache_model("sprites/lgtning.spr")
    
spr_burn     =     precache_model("sprites/plasma_exp.spr")
    
explosion[T]   =   precache_model("sprites/goalT.spr")
    
explosion[CT]   =   precache_model("sprites/goalCT.spr")
}

flameWave(myorig[3], team) {
    
message_begin(MSG_BROADCASTSVC_TEMPENTITYmyorig
    
write_byte(21
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2] + 16
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2] + 500
    
write_short(spr_fire)
    
write_byte(0)         // startframe 
    
write_byte(0)         // framerate 
    
write_byte(15)         // life 2
    
write_byte(50)         // width 16 
    
write_byte(10)         // noise 
    
write_byte(TeamColors[team][2])     // r 255
    
write_byte(TeamColors[team][1])         // g 0
    
write_byte(TeamColors[team][0])         // b 0
    
write_byte(255)     // brightness 
    
write_byte(10)     // speed 
    
message_end() 
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig
    
write_byte(21
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2] + 16
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2] + 500
    
write_short(spr_fire)
    
write_byte(0)         // startframe 
    
write_byte(0)         // framerate 
    
write_byte(10)         // life 2
    
write_byte(70)         // width 16 
    
write_byte(10)         // noise 
    
write_byte(TeamColors[team][2])     // r 255
    
write_byte(TeamColors[team][1])         // g 50
    
write_byte(TeamColors[team][0])         // b 0
    
write_byte(200)     // brightness 
    
write_byte(9)     // speed 
    
message_end() 
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,myorig)
    
write_byte(21)
    
write_coord(myorig[0])
    
write_coord(myorig[1])
    
write_coord(myorig[2] + 16
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2] + 500
    
write_short(spr_fire)
    
write_byte(0)         // startframe 
    
write_byte(0)         // framerate 
    
write_byte(10)         // life 2
    
write_byte(90)         // width 16 
    
write_byte(10)         // noise 
    
write_byte(TeamColors[team][2])     // r 255
    
write_byte(TeamColors[team][1])     // g 100
    
write_byte(TeamColors[team][0])         // b 0    
    
write_byte(200)     // brightness 
    
write_byte(8)     // speed 
    
message_end() 
    
    
//Explosion2 
    
message_beginMSG_BROADCASTSVC_TEMPENTITY
    
write_byte(12
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2])
    
write_byte(80)     // byte (scale in 0.1's) 188 
    
write_byte(10)     // byte (framerate) 
    
message_end() 
    
    
//TE_Explosion 
    
new id
    message_begin
MSG_BROADCASTSVC_TEMPENTITY 
    
write_byte(3)
    
write_byte(id)
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2])
    
write_short (explosion[get_user_team(id)])
    
write_byte(65)     // byte (scale in 0.1's) 188 
    
write_byte(10)     // byte (framerate) 
    
write_byte(0)     // byte flags 
    
message_end() 
    
    
//Smoke 
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY,myorig
    
write_byte(5)
    
write_coord(myorig[0]) 
    
write_coord(myorig[1]) 
    
write_coord(myorig[2]) 
    
write_short(spr_smoke)
    
write_byte(50)
    
write_byte(10)
    
message_end()
    
    return 
PLUGIN_HANDLED 

At the "TE_explosion" is the problem..cause if put without get_user_team(id),new id and new explosion[TEAMS] (only new explosion),it works...how can i fix this?

aaarnas 01-18-2013 21:03

Re: Error: "New message started when msg '23' has not been sent yet"
 
The problem should be, that get_user_team(id) may calling another messages when you haven't finished this (message_end()).
You should check value before message_begin, but looking at plugin logic, flameWave(myorig[3], team) "team" already should be what you need. So:
write_short (explosion[get_user_team(id)])
-->>
write_short (explosion[team])

But it's just a guess, because I see only a part of code.

Spy123 01-19-2013 14:17

Re: Error: "New message started when msg '23' has not been sent yet"
 
@aaarnas...god bless you! It works now:D Thanks a lot...


All times are GMT -4. The time now is 13:42.

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