AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spectator Bug (https://forums.alliedmods.net/showthread.php?t=278837)

driger38 02-09-2016 09:11

Spectator Bug
 
Player is alive in either CT or T. He chooses to GO SPECTATOR, player gets to be joined spectator team. BUT he stays alive as in spec team (can kill CT/T, can be killed also).
the line that should kill him in plugin is :

Code:

                case 4:
                {
                        if( is_user_alive( id ) )
                        {
                                client_cmd( id, "kill" )
                                cs_set_user_deaths( id, cs_get_user_deaths( id ) - 1 )
                                fm_set_user_frags( id, get_user_frags( id ) + 1 )
                        }
                        cs_set_user_team( id, CS_TEAM_SPECTATOR, CS_DONTCHANGE )
                }
        }

The part where he is supposed to DIE while going spec team wont function, Any help pls?

siriusmd99 02-09-2016 09:18

Re: Spectator Bug
 
replace client_cmd(id,"kill") with user_kill(id)

client cmd is considered as slowhacking and is being blocked by client guard.

driger38 02-09-2016 09:24

Re: Spectator Bug
 
it is not intentional, i swear. I try change now, Thanks.




THANK YOU VERY MUCH, IT WORKED :3


I appreciate for the fast response :)

driger38 02-09-2016 09:32

Re: Spectator Bug
 
Code:

engclient_cmd(id, "joinclass", "5")
is that slowhacking also? the thing is that it should join the Team but plugin should put him in team without him getting to choose what class to join.

wickedd 02-09-2016 10:11

Re: Spectator Bug
 
No it's not

driger38 02-09-2016 10:30

Re: Spectator Bug
 
but then it shoud automatically join class 5 right? right now i still must use what class i need to use, How to change that. It is in both sides if i am joining from SPEC team, not while connecting

siriusmd99 02-09-2016 10:33

Re: Spectator Bug
 
no, dont use engclient_cmd, use :
cs_set_user_team( id, CS_TEAM_SPECTATOR )

driger38 02-09-2016 12:22

Re: Spectator Bug
 
Code:

if (cs_get_user_team(id)==CS_TEAM_CT)
                        {
                                new iMsgBlock = get_msg_block(114);
                                set_msg_block(114, BLOCK_SET);
                                engclient_cmd(id, "jointeam", "1")
                                engclient_cmd(id, "joinclass", "5")
                                set_msg_block(114, iMsgBlock)

Which line needs to be edited so he joins CT without getting a chance to choose a ćlass, but gets decided randomly (server has one model for every class, so i dont need them to choose class)

siriusmd99 02-09-2016 14:27

Re: Spectator Bug
 
just use this :

PHP Code:

case 4//Case 'Go spectate'
        
{
            if( 
is_user_aliveid ) )
            {
                
user_kill(id)
                
cs_set_user_deathsidcs_get_user_deathsid ) - )
                
fm_set_user_fragsidget_user_fragsid ) + )
            }
            
cs_set_user_teamidCS_TEAM_SPECTATORCS_DONTCHANGE )
        } 



All times are GMT -4. The time now is 09:21.

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