Help me

Started by (SpCy)Alex, Jun 19, 2018, 07:02 PM

Previous topic - Next topic

(SpCy)Alex

It's been a while since I tried to make an anti-spam system but it does not work. Now that it works, the server crashed. Could someone help me?


class PlayerStats
{
Kills = 0;
Selected = null;
Count_Msg = 0;
Msg_Player = 0;
}
if ( Multa[ player.ID ] >= 1 ) E_MSG( "Usted esta muteado del chat por hacer spam!", player );
else
{
ClientMessageToAll( player.Name + "[#FFFFFF]: " + text, player.Color.r, player.Color.g, player.Color.b );
if ( text.slice( 0, 1 ) == "!" && text.find("! ") == null )
{
local i = NumTok( text, " " ), xp = null;
if ( i == 1 ) onPlayerCommand2( player, GetTok( text.slice( 1 ), " ", 1 ), xp );
else onPlayerCommand2( player, GetTok( text.slice( 1 ), " ", 1 ), GetTok( text.slice( 1 ), " ", 2, i ) );
}
CheckSpam( player, "Spam" );
return 1;
}
}

function CheckSpam( player, reason )
{
local MSNxSEC = 2000, LIMIT_REP_SPAM = 3;
local spammer = ( GetTickCount() - status[ player.ID ].Count_Msg ) / MSNxSEC;
status[ player.ID ].Msg_Player += spammer - 1;
if ( status[ player.ID ].Msg_Player > LIMIT_REP_SPAM ) status[ player.ID ].Msg_Player = LIMIT_REP_SPAM - 1;
if ( status[ player.ID ].Msg_Player < 0 ) status[ player.ID ].Msg_Player = -1;
status[ player.ID ].Count_Msg = GetTickCount();
if ( status[ player.ID ].Msg_Player < 0)
{
if ( Multa[ player.ID ] == 0 )
{
Multa[ player.ID ] = 30;
I_MSG( "Usted fue muteado por hacer spam.", player );
A_MSG( "Auto-Mute " + player.Name + ", ID: " + player.ID + ". Motivo:[ " + reason + " ].", player );
}
}
}

function UnMute( admin, player )
{
Multa[ player.ID ] = 0;
MSG( "Admin " + admin + " desmuteo " + player.Name + "." );
}
function S_MSG( text, player ) MessagePlayer( "[#00FF00]|SINTAXE|[#FFFFFF] " + text, player );

function E_MSG( text, player ) MessagePlayer( "[#FFA500]|ERRO|[#FFFFFF] " + text, player );

function I_MSG( text, player ) MessagePlayer( "[#00BFFF]|INFO|[#FFFFFF] " + text, player );

function A_MSG( text, player )

if someone could look at it and help me to know why the server crashed

MEGAMIND

first of all thats a mess, second put ur code in [ code button ] which will not irriate anyone, third here u may find ur problem http://forum.vc-mp.org/?topic=1717.0

(SpCy)Alex


(SpCy)Alex

But this is for 0.4rel04?


NicusorN5

OnScriptLoad() :
MutedPlrs <- array(100,false);
LastMsg  <- array(100,"")
Tries <- array(100,0)

OnPlayerChat(...)
{
 if(text == LastMsg[player.ID] ) Tries[player.ID] += 1;
 if(Tries[player.ID] == 3 ) MutedPlrs[player.ID] = true;
 if(MutedPlrs[players.ID] == true) return 0;
 else
 {
   //other code
  }
}

Unmute command:
if(cmd == "unmute")
{
 MutedPlrs[text.tointeger] = false;
 Message("Unmuted player id"+ text
}[code]

UrbanY

Quote from: (SpCy)Alex on Jun 19, 2018, 07:02 PMIt's been a while since I tried to make an anti-spam system but it does not work. Now that it works, the server crashed. Could someone help me?


class PlayerStats
{
Kills = 0;
Selected = null;
Count_Msg = 0;
Msg_Player = 0;
}
if ( Multa[ player.ID ] >= 1 ) E_MSG( "Usted esta muteado del chat por hacer spam!", player );
else
{
ClientMessageToAll( player.Name + "[#FFFFFF]: " + text, player.Color.r, player.Color.g, player.Color.b );
if ( text.slice( 0, 1 ) == "!" && text.find("! ") == null )
{
local i = NumTok( text, " " ), xp = null;
if ( i == 1 ) onPlayerCommand2( player, GetTok( text.slice( 1 ), " ", 1 ), xp );
else onPlayerCommand2( player, GetTok( text.slice( 1 ), " ", 1 ), GetTok( text.slice( 1 ), " ", 2, i ) );
}
CheckSpam( player, "Spam" );
return 1;
}
}

function CheckSpam( player, reason )
{
local MSNxSEC = 2000, LIMIT_REP_SPAM = 3;
local spammer = ( GetTickCount() - status[ player.ID ].Count_Msg ) / MSNxSEC;
status[ player.ID ].Msg_Player += spammer - 1;
if ( status[ player.ID ].Msg_Player > LIMIT_REP_SPAM ) status[ player.ID ].Msg_Player = LIMIT_REP_SPAM - 1;
if ( status[ player.ID ].Msg_Player < 0 ) status[ player.ID ].Msg_Player = -1;
status[ player.ID ].Count_Msg = GetTickCount();
if ( status[ player.ID ].Msg_Player < 0)
{
if ( Multa[ player.ID ] == 0 )
{
Multa[ player.ID ] = 30;
I_MSG( "Usted fue muteado por hacer spam.", player );
A_MSG( "Auto-Mute " + player.Name + ", ID: " + player.ID + ". Motivo:[ " + reason + " ].", player );
}
}
}

function UnMute( admin, player )
{
Multa[ player.ID ] = 0;
MSG( "Admin " + admin + " desmuteo " + player.Name + "." );
}
function S_MSG( text, player ) MessagePlayer( "[#00FF00]|SINTAXE|[#FFFFFF] " + text, player );

function E_MSG( text, player ) MessagePlayer( "[#FFA500]|ERRO|[#FFFFFF] " + text, player );

function I_MSG( text, player ) MessagePlayer( "[#00BFFF]|INFO|[#FFFFFF] " + text, player );

function A_MSG( text, player )

if someone could look at it and help me to know why the server crashed
Es el sistema de diego PDJ

(SpCy)Alex

Lo que tu digas el que copia servers i cambia los creditos
Dices que haces muchas pero estan echas por los demas tu solo cambias los nombres i dices que son tuyos!
Yo que tu me callaria la boca dices que haces muchas cosas pero estan echas por los demas

What you say the one that copies servers and changes the credits
You say you do a lot but you're done by others you just change the names and say they're yours
I that your mouth shut me up say you do many things but are thrown by others

MEGAMIND


NicusorN5

Quote from: (SpCy)Alex on Jun 20, 2018, 09:35 AMWhat you say the one that copies servers and changes the credits
You say you do a lot but you're done by others you just change the names and say they're yours
I that your mouth shut me up say you do many things but are thrown by others
I can't understand a shit there. Please any one translate this for me correctly.

MEGAMIND

Quote from: Athanatos(^_^) on Jun 20, 2018, 02:32 PM
Quote from: (SpCy)Alex on Jun 20, 2018, 09:35 AMWhat you say the one that copies servers and changes the credits
You say you do a lot but you're done by others you just change the names and say they're yours
I that your mouth shut me up say you do many things but are thrown by others
I can't understand a shit there. Please any one translate this for me correctly.
hes pointing something he wants to convay towards  UrbanY

UrbanY

Si claro lo que digas no tengo nada copiado como dices tu sin embargo tu server si es 100% copiado, JonaVK No diría lo contrario porque usas su server y tienes 2 versiones mas de el,Tambien tienes virus en tu server para extraer los servidores de los demás,una vez trate de ayudarte en tu server con trabajos y lo que hiciste fue decir que un exe era un note pad para que te lo envie ahi y mi antivirus dijo lo contrario,tengo las pruebas de que lo enviaste Link: https://imgur.com/a/zKh5mwn

NicusorN5

#11
^ Ok then .-.