AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Message still getting displayed after reconnecting. (https://forums.alliedmods.net/showthread.php?t=251385)

Akshat 11-12-2014 05:47

Message still getting displayed after reconnecting.
 
I edited a plugin by GuskiS which kicks players using minmodels.. I added a message which would be displayed to the players in the server that the player is using minmodels.. but when the player reconnects after removing minmodels then also the message gets displayed.

I hope you understand what am saying.

Thanks!

Code-
Code:


#include <amxmodx>
#include <colorchat>

public plugin_init()
{
#define PLUGIN                "Block Minmodels"
#define VERSION                "2.0"
#define AUTHOR                "GuskiS"

register_plugin(PLUGIN, VERSION, AUTHOR);
}


public client_disconnect(id)
{
        if(task_exists(id))
                remove_task(id);
}

public client_putinserver(id)
{
        if(!is_user_bot(id) && !is_user_hltv(id))
                set_task(5.0, "query_him", id);
}

public query_him(id)
        if(is_user_connected(id))
                query_client_cvar(id, "cl_minmodels", "Query_Results");

public Query_Results(id, const cvar[], const val[])
{
        if(floatstr(val) == 1.0)
                server_cmd( "kick #%i %s", get_user_userid(id), "Stop using cl_minmodels 1!");
               
        {
            new name[33]
                get_user_name(id, name, 32)
                ColorChat(0, print_chat, "^3[^4AMXX^3] ^3%s ^1Just Tried To Use ^4MinModels ^1And Got Kicked.", name)

        }

        if(!task_exists(id))
                set_task(2.0, "query_him", id, _, _, "b");
               

}


Akshat 11-12-2014 10:54

Re: Message still getting displayed after reconnecting.
 
Solved.

aron9forever 11-15-2014 07:53

Re: Message still getting displayed after reconnecting.
 
your plugin is easy to bypass, btw, by setting the cvar 5 seconds after you connected
do a set_task instead and go trough all the players


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

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