AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   small edit please. (https://forums.alliedmods.net/showthread.php?t=327149)

Stefanos 09-03-2020 12:59

small edit please.
 
1 Attachment(s)
hello i need this plugin to be edited:

http://prntscr.com/ub0r4o

this message to show only for player that got SLAY and ADMIN_RCON (flag L )
and that message in red color please!

and please slay on 5 seconds, not every second, thanks <3

Supremache 09-04-2020 12:30

Re: small edit please.
 
Quote:

Originally Posted by Stefanos (Post 2716516)
hello i need this plugin to be edited:

http://prntscr.com/ub0r4o

this message to show only for player that got SLAY and ADMIN_RCON (flag L )
and that message in red color please!

and please slay on 5 seconds, not every second, thanks <3

i dont understand anything and i have no idea for how to edit .dat file give me sma and i will try to do what u want but after give me more details

Stefanos 09-04-2020 13:14

Re: small edit please.
 
Can u look this image http://prntscr.com/ub0r4o

That text i want in red color

Plugin slay player that have more than 125fps
And spam message in chat when someone get slayed
For that. So i want that message i screnshoted to be only seenable
For player that got slayed and for flag L

And if you can make to slay on 5 seconds not every second. Because i use autorespawn..

Stefanos 09-04-2020 13:14

Re: small edit please.
 
and .dat file just open with notepad u will get full code.. im not home now. Sorry and thank you sir

Supremache 09-04-2020 13:22

Re: small edit please.
 
1 Attachment(s)
Quote:

Originally Posted by Stefanos (Post 2716632)
and .dat file just open with notepad u will get full code.. im not home now. Sorry and thank you sir

I will see what i can do

Edit: I think i did what you want but about color i added team color because it's .dat so i think it's working by moudels and i can't add .inc file to it, so i used stock for color chat

P.s: If u want to change max fps, type in console amx_cvar "amx_maxfps" "Max fps Number"

Stefanos 09-05-2020 01:54

Re: small edit please.
 
Can u add that message to be seen only by person that got slayed?
and can u make slay on 5 seconds, not every second.

Supremache 09-05-2020 07:19

Re: small edit please.
 
Quote:

Originally Posted by Stefanos (Post 2716716)
Can u add that message to be seen only by person that got slayed?
and can u make slay on 5 seconds, not every second.

1. You said you want only admin rcon and who got slayed can see msg and i did that.

PHP Code:

if(get_user_flags(id) & ADMIN_RCON)
                
ChatColor(0"Player !g%s!t slayed for using more fps than allowed(100)",name)
            else
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name

2. You said you want who got slayed get spam msg and i already did that
PHP Code:

public playerSpawn(id)
{
    if(!
alive[id])
    {
        new 
name[32]
        
get_user_name(id,name,31)
            
        
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
        return 
PLUGIN_HANDLED
    
}
    
    
alive[id] = 1
    
return PLUGIN_CONTINUE


3. You said you want who have more than 125 fps get slay every 5 sec not every sec and i did that
changed task from 1.0 to 5.0 "set_task(5.0"

PHP Code:

public client_putinserver(id)
{
    
iFrames[id] = 0
    set_task
(5.0"ShowFps",id+DEVELOPER_OFFSET__"b");


4. there's one thing you can do, Edit those codes
From:

PHP Code:

public eventDeath()
{
    new 
victim read_data(2)
    if(
is_user_valid(victim))
    {
        
alive[victim] = 0
    
}


to:
PHP Code:

public eventDeath()
{
    
set_task(5.0"FactionDeath",id+DEVELOPER_OFFSET__"b");
}

public 
FactionDeath()
{
    new 
victim read_data(2)
    if(
is_user_valid(victim))
    {
        
alive[victim] = 0
    
}



Stefanos 09-05-2020 12:34

Re: small edit please.
 
plugin does not work now at all, everyone gots that message evne if they have less fps, and no slay ...

Supremache 09-05-2020 12:59

Re: small edit please.
 
Quote:

Originally Posted by Stefanos (Post 2716778)
plugin does not work now at all, everyone gots that message evne if they have less fps, and no slay ...

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define DEVELOPER_OFFSET         768
#define MAXWARNS 3
#define is_user_valid(%1) (1 <= %1 <= 32)
new cvar_MaxFps;
new 
iFrames[33]
new 
iWarnings[33]
new 
alive[33]

public 
plugin_init()
{
    
register_plugin("Anti-developer""1.0""NeuTroN aka Menethil"
    
register_forward(FM_PlayerPreThink"Fwd_PlayerPreThink"
    
cvar_MaxFps register_cvar("amx_maxfps""125")
    
register_event"DeathMsg""eventDeath""a" )
    
RegisterHam(Ham_Spawn,"player","playerSpawn")
}

public 
Fwd_PlayerPreThink(id)
{
    if(!
alive[id])
        return 
FMRES_IGNORED
    iFrames
[id]++   
    return 
FMRES_IGNORED
}


public 
client_putinserver(id)
{
    
iFrames[id] = 0
    set_task
(5.0"ShowFps",id+DEVELOPER_OFFSET__"b");
}

public 
ShowFps(id)
{   
    
id-=DEVELOPER_OFFSET
    
if(is_user_alive(id) && iFrames[id] >= get_pcvar_num(cvar_MaxFps))
    {
        
iWarnings[id]++
        if(
iWarnings[id] >= MAXWARNS)
        {
            new 
name[32]
            
get_user_name(id,name,31)

            
user_kill(id)
            
            if(
get_user_flags(id) & ADMIN_RCON)
                
ChatColor(0"Player !g%s!t slayed for using more fps than allowed(100)",name)
            else
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
        }
    }       
    
iFrames[id] = 0
}

public 
client_disconnect(id)
{
    if(
task_exists(id+DEVELOPER_OFFSET))
    {
        
remove_task(id+DEVELOPER_OFFSET)
    }
}

public 
playerSpawn(id)
{
    
alive[id] = 1
    
return PLUGIN_CONTINUE
}   

public 
eventDeath()
{
    new 
victim read_data(2)
    if(
is_user_valid(victim))
    {
        
alive[victim] = 0
    
}
}

stock ChatColor(const id, const input[], any:...) 
{
    
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4"); // verde
    
replace_all(msg190"!n""^1"); // galben/alb/negru
    
replace_all(msg190"!t""^3"); // rosu/albastru/gri
    
replace_all(msg190"!t2""^0"); // rosu2/albastru2/gri2
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
            {
            if (
is_user_connected(players[i]))
                {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }



Stefanos 09-05-2020 13:26

Re: small edit please.
 
everyone get slayed for fps more than 100 even if they have less...

Foxa 09-05-2020 18:11

Re: small edit please.
 
Why is your code a .dat file??

Of course everyone gets slayed, cause he changed the task delay from 1.0 to 5.0 which results in players having (about) "500 fps", you can't reset a variable that counts something PER SECOND every 5 seconds..

PHP Code:

set_task(5.0"ShowFps",id+DEVELOPER_OFFSET__"b"); 

->
PHP Code:

set_task(1.0"ShowFps",id+DEVELOPER_OFFSET__"b"); 

This
PHP Code:

if(get_user_flags(id) & ADMIN_RCON)
                
ChatColor(0"Player !g%s!t slayed for using more fps than allowed(100)",name

does not do what he asked, that prints a message to EVERYONE (since the index is set to 0) when someone with ADMIN_RCON level had been slayed

This is just ridiculous..
PHP Code:

else
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name)
                
ChatColor(id"!g%s!t slayed for using more fps than allowed(100)",name


Stefanos 09-05-2020 18:39

Re: small edit please.
 
aj mi ti uradi molim te xd <3

Stefanos 09-06-2020 00:05

Re: small edit please.
 
anyone help me fast please...

Foxa 09-06-2020 12:40

Re: small edit please.
 
Quote:

Originally Posted by Stefanos (Post 2716830)
aj mi ti uradi molim te xd <3

The plugin doesn't count frames correctly anyways, something like this would be better, although it can still result in false positives

PHP Code:

#include <amxmodx>

#include <fakemeta>
#include <colorchat>
#include <cstrike>

#pragma semicolon true

new const    PLUGIN[]    =    "My",
        
VERSION[]    =    "Name",
        
AUTHOR[]    =    "Jeff";
        
#define MAX_PLAYERS     32
#define DELAY         1.0
#define DELAY_DO    5.0
#define TASKID_DO     312

new g_iFPS[MAX_PLAYERS+1];
new 
g_iPunishFPS[MAX_PLAYERS+1];
new 
cvFPSLimit;
new 
cvSlay;

public 
plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_PlayerPreThink"fwdPlayerPreThink");
    
    
cvFPSLimit=register_cvar("fps_limit""101");
    
cvSlay=register_cvar("fps_slay""1");
}

public 
fwdPlayerPreThink(id){
    static 
FloatfgametimeFloatfcountnext[MAX_PLAYERS+1], iframes[MAX_PLAYERS+1];
    
    if(
fcountnext[id]>=(fgametime=get_gametime())){
        
iframes[id]++;
        return 
FMRES_IGNORED;
    }
    
    
g_iFPS[id]=iframes[id];
    if(
g_iFPS[id]>get_pcvar_num(cvFPSLimit) && is_user_alive(id) && !task_exists(id+TASKID_DO) && cs_get_user_team(id)==CS_TEAM_CT){
        
g_iPunishFPS[id]=g_iFPS[id];
        
set_task(DELAY_DO"task_DoWhatever"id+TASKID_DO);
    }
    
    
iframes[id]=0;
    
    
fcountnext[id]=fgametime+DELAY;
    return 
FMRES_IGNORED;
}

public 
task_DoWhatever(const taskid){
    new 
id=taskid-TASKID_DO;
    new 
name[32];
    
get_user_name(idnamecharsmax(name));
    if(
get_pcvar_num(cvSlay)!=0){
        
ColorChat(idRED"You are slayed for using more FPS than allowed (type fps_max 100 in console)");
        
user_silentkill(id);
    }
    
    new 
players[MAX_PLAYERS], num;
    
get_players(playersnum);
    for(new 
i=0i<numi++){
        if(
get_user_flags(players[i]) & ADMIN_RCON)
            
ColorChat(players[i], RED"%s - FPS: %d"nameg_iPunishFPS[id]);
    }


colorchat.inc
PHP Code:

/* Fun functions
*
* by Numb
*
* This file is provided as is (no warranties).
*/


enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    static 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    static 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    
message_begin(typeget_user_msgid("SayText"), _id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    
message_begin(typeget_user_msgid("TeamInfo"), _id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    static 
i;
    
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
        {
            return 
i;
        }
    }

    return -
1;



Cirovic 09-06-2020 14:28

Re: small edit please.
 
it bugs, player got slayed and i got message that they had 89 fps and still got slayed.. can we try on my plugin edit what i wanted?

Foxa 09-06-2020 20:28

Re: small edit please.
 
Ah yes, it shows different FPS since the task if created once the player HAS more than the said FPS and it takes 5 seconds to execute the task, hence the number of frames changes.
Should work now (i edited the code above), I also told you that the plugin you were using displays wrong number of frames A LOT
Code:

99
99
110
99
99
109
99
99
99
109


Cirovic 09-06-2020 20:35

Re: small edit please.
 
okay i will test now, can you add message for player that got slayed why he got slayed

* You are slayed for using more FPS than allowed (type fps_max 100 in console)

Supremache 09-06-2020 20:40

Re: small edit please.
 
Quote:

Originally Posted by Cirovic (Post 2716967)
okay i will test now, can you add message for player that got slayed why he got slayed

* You are slayed for using more FPS than allowed (type fps_max 100 in console)

I dont know why you are important about this plugin and you can add simple plugin for replace 100 fps to all players automatically

Cirovic 09-06-2020 20:43

Re: small edit please.
 
there are guardians that does not allow for server to change players settings :/

Foxa 09-06-2020 20:45

Re: small edit please.
 
Quote:

Originally Posted by Cirovic (Post 2716967)
okay i will test now, can you add message for player that got slayed why he got slayed

* You are slayed for using more FPS than allowed (type fps_max 100 in console)

Done

Quote:

Originally Posted by Supremache (Post 2716968)
I dont know why you are important about this plugin and you can add simple plugin for replace 100 fps to all players automatically

Um... slowhacking??

Supremache 09-06-2020 20:46

Re: small edit please.
 
Quote:

Originally Posted by Cirovic (Post 2716971)
there are guardians that does not allow for server to change players settings :/

I will share my privite plugin soon, server settings plugin but i doing some updates on it

Cirovic 09-06-2020 21:34

Re: small edit please.
 
And foxa please this plugin only slay CT team!!!

Foxa 09-07-2020 05:08

Re: small edit please.
 
Forgot about that, sorry.. The code has been edited.

Rohanlogs 09-07-2020 13:10

Re: small edit please.
 
2 Attachment(s)
Quote:

Originally Posted by Foxa (Post 2716909)
The plugin doesn't count frames correctly anyways, something like this would be better, although it can still result in false positives
.....

Eh, it looks a bit messy..
Lag spikes can cause players to get slayed for no reason since you don't even have warning count, and also because of this fps limit should be somewhere in 110.
I never understood this 'TASKID_DO' thing. Why not just pass the client index as the taskid? There's nothing wrong with that.
Perhaps you should check in x second intervals if client's fps is illegal and have at least 3 warnings.
This will reduce false positives drastically, if not get rid of them completely.

I've written at least a little better version of this feel free to use it..
It has all the features were requested and it logs client warnings into your logs directory.
If you're still getting false positives try increasing amx_max_fps.
You can modify how often (seconds) a client is being checked via amx_fps_check.

Spoiler

Cirovic 09-07-2020 16:06

Re: small edit please.
 
y this is good rohan, but can u remove WARNING messages pelase only slay, and fix slay. it does not slay player. just says.

Rohanlogs 09-08-2020 02:33

Re: small edit please.
 
Quote:

Originally Posted by Cirovic (Post 2717075)
y this is good rohan, but can u remove WARNING messages pelase only slay, and fix slay. it does not slay player. just says.

It does slay on the 4th warning in a row with a 5 second delay as requested. This is to confirm that the player is using high FPS and to avoid false positives. I've removed the warning message.
If you'd like the slay to occur faster you can decrease MAXWARNINGS or amx_fps_check but again this can lead to people getting slayed due to lag.


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

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