AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SetFOV and kick (https://forums.alliedmods.net/showthread.php?t=143646)

Tonda 11-22-2010 11:24

SetFOV and kick
 
hi all, i have script

Code:

if (cs_get_user_team(id) == CS_TEAM_CT)
                {
                new gmsg_SetFOV        = get_user_msgid("SetFOV");
                if(is_user_alive(id))
                {
                message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id );
                write_byte( 0 );
                message_end( );
                }
                }
                return PLUGIN_HANDLED;

this code remove this script

Code:

if (cs_get_user_team(id) == CS_TEAM_CT)
                {
                new gmsg_SetFOV        = get_user_msgid("SetFOV");
                if(is_user_alive(id))
                {
                message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id );
                write_byte( 180 );
                message_end( );
                }
                }
                return PLUGIN_HANDLED;

But sometimes players are kicked with : Reliable channel overflowed. Why?

Exolent[jNr] 11-22-2010 12:42

Re: SetFOV and kick
 
MSG_ONE -> MSG_ONE_UNRELIABLE

Tonda 11-23-2010 08:11

Re: SetFOV and kick
 
Quote:

Originally Posted by Exolent[jNr] (Post 1354498)
MSG_ONE -> MSG_ONE_UNRELIABLE

Ok i try it but still kicked :(

Exolent[jNr] 11-23-2010 08:38

Re: SetFOV and kick
 
You are sending too many messages to the player. Show your full code.

abdul-rehman 11-23-2010 08:53

Re: SetFOV and kick
 
Code:
        message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id );         write_byte( 0 );         message_end( );
You sure that setting the player's FOV to 0 isnt the cause for reliable channel over flowed /

ConnorMcLeod 11-23-2010 08:57

Re: SetFOV and kick
 
Should set pdata m_iFOV instead of sending the message

Code:
#define XO_PLAYER       5 #define m_iFOV          363 SetUserFov(id, iFOV) {     set_pdata_int(id, m_iFOV, iFOV, XO_PLAYER)     set_pev(id, pev_fov, iFOV) }

Tonda 11-24-2010 09:35

Re: SetFOV and kick
 
Quote:

Originally Posted by ConnorMcLeod (Post 1355065)
Should set pdata m_iFOV instead of sending the message


Code:
#define XO_PLAYER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;5</p><p>#define m_iFOV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;363</p><p>&nbsp;</p><p>SetUserFov(id, iFOV)</p><p>{</p><p>&nbsp;&nbsp;&nbsp;&nbsp;set_pdata_int(id, m_iFOV, iFOV, XO_PLAYER)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;set_pev(id, pev_fov, iFOV)</p><p>}

So, what you say, this is the same with better way ?

Code:

if (cs_get_user_team(id) == CS_TEAM_CT)
        {
        new gmsg_SetFOV    = get_user_msgid("SetFOV");
        if(is_user_alive(id))
        {
        message_begin( MSG_ONE, gmsg_SetFOV, { 0, 0, 0 }, id );
        write_byte( 0 );
        message_end( );
        }
        }
        return PLUGIN_HANDLED;


bibu 11-24-2010 13:46

Re: SetFOV and kick
 
Quote:

Originally Posted by ConnorMcLeod (Post 1355065)
Should set pdata m_iFOV instead of sending the message

Code:
#define XO_PLAYER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;5 #define m_iFOV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;363 SetUserFov(id, iFOV) { &nbsp;&nbsp;&nbsp;&nbsp;set_pdata_int(id, m_iFOV, iFOV, XO_PLAYER) &nbsp;&nbsp;&nbsp;&nbsp;set_pev(id, pev_fov, iFOV) }

Connor, how to use that, I am trieing it like that, but it doesn't work:

PHP Code:

SetUserFov(victimget_pcvar_num(cvar)) 



All times are GMT -4. The time now is 11:18.

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