AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MSG_ONE or MSG_ONE_UNRELIABLE with no target entity (https://forums.alliedmods.net/showthread.php?t=153463)

EclipseCP 03-23-2011 18:38

MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
 
error (title) in this code

MSG_ONE or MSG_ONE_UNRELIABLE with no target entity

PHP Code:

                for (new 132i++) {
                    if (
is_user_alive(i) == 1) {
                        
get_user_origin(iPlayerPos)
                        
Distance get_distance(PlayerPosorigin2)
                        if (
Distance <= Damage_Radius) {  // Screenshake Radius
                            
                            
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, i)  // Shake Screen
                            
write_short(1<<14)
                            
write_short(1<<14)
                            
write_short(1<<14)
                            
message_end()

                            
Damage Max_Damage floatround(floatmul(float(Max_Damage), floatdiv(float(Distance), float(Damage_Radius))))
                            
//if(!zp_get_user_zombie(id2) && !zp_get_user_nemesis(id2))
                            
do_victim(i,victim,Damage,0)
                        }
                        
                    } 

a solution?

kotinha 03-23-2011 18:50

Re: MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
 
I'm not sure about this but try it anyway :P
PHP Code:

                for (new 132i++) {
                    if (
is_user_alive(i) && is_user_connected(i)) {
                        
get_user_origin(iPlayerPos)
                        
Distance get_distance(PlayerPosorigin2)
                        if (
Distance <= Damage_Radius) {  // Screenshake Radius
                            
                            
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, i)  // Shake Screen
                            
write_short(1<<14)
                            
write_short(1<<14)
                            
write_short(1<<14)
                            
message_end()

                            
Damage Max_Damage floatround(floatmul(float(Max_Damage), floatdiv(float(Distance), float(Damage_Radius))))
                            
//if(!zp_get_user_zombie(id2) && !zp_get_user_nemesis(id2))
                            
do_victim(i,victim,Damage,0)
                        }
                        
                    } 


EclipseCP 03-23-2011 19:16

Re: MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
 
Thanks. I'll try later to see if it still happens. The problem was that upon entering the switch map throw "Bad character in client command", and read the logs, and it said that I put in the title :3:P

Sorry Bad English

ConnorMcLeod 03-24-2011 03:08

Re: MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
 
Consider using get_players with flag "a", you will get a list of connected alive players.

mabaclu 03-24-2011 06:25

Re: MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
 
Im not sure but I think you should check for bots too.


All times are GMT -4. The time now is 14:34.

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