AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Limit Plugin Messages. (https://forums.alliedmods.net/showthread.php?t=251408)

Akshat 11-12-2014 11:00

[HELP] Limit Plugin Messages.
 
I am using this plugin which blocks cl_minmodels 1 command.. players keep spamming the command in console and the chat gets flooded. Help :/

Code:

#include <amxmodx>
#include <colorchat>

public plugin_init()
{
register_plugin("No MinModels", "2.0" , "GuiSkis")
}

public client_putinserver(id)
{
set_task(5.0, "First_Query", id)
}

public First_Query(id)
{
if ( is_user_connected(id) )
{
query_client_cvar(id, "cl_minmodels", "Cl_MinModels_Value")
}
}

public Cl_MinModels_Value(id, szCvar[], szValue[])
{
if ( is_user_connected(id) )
{
if ( szValue[0] != '0' || szValue[1] )
{


new name[33]
get_user_name(id, name, 32)
ColorChat(0, TEAM_COLOR, "[^4AMXX^3] %s ^1Tried to use ^4MinModels ^1which is not allowed on this server, so it has been set to ^4default^1.", name)
       
       

}
client_cmd(id, ";cl_minmodels 0")
}
query_client_cvar(id, "cl_minmodels", "Cl_MinModels_Value")
}


Jhob94 11-12-2014 11:13

Re: [HELP] Limit Plugin Messages.
 
Don't create multiple threads for the same problem.
Post the code correctly, the lines are a mess, i dont even try to read it. Yet i saw this: client_cmd(id, ";cl_minmodels 0"), that's slowhack and isnt supported here


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

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