Hello all i am new on forum but i am old in vcmp.
I make a script i want some code that if player spam get auto kick.
Can anyone give please anyone can give it to me.
I am waiting Friend.
F*ING DEFINE SPAM!!!
Like this:-
I am not spammer.
i am not spammer.
i am not spammer.
i am not spammer.
Like repeat one message again and again and get auto kick.
I can't even begin to explain the stupidity of this but oh well.
local g_ChatHistory = array(GetMaxPlayers());
function onPlayerJoin(player)
{
g_ChatHistory[player.ID] = [];
}
function onPlayerPart(player, reason)
{
g_ChatHistory[player.ID] = null;
}
function onPlayerChat(player, text)
{
local match = 0, history = g_ChatHistory[player.ID];
foreach (msg in history)
{
if ((text == msg) && (++match >= 4))
{
player.Kick();
return false;
}
}
history.insert(0, text);
if (history.len() > 4)
{
history.pop();
}
}
He won't understand that.
Quote from: KAKAN on Oct 21, 2015, 03:51 PMHe won't understand that.
how's that my problem?
When you ask a question then be prepared to understand the answer. Otherwise GTFO.
I know, but he's a beginner.
Quote from: KAKAN on Oct 21, 2015, 04:01 PMI know, but he's a beginner.
So we can't give a decent answer because he wont understand it? How's he gonna learn from it then?
Okay sorry.
Quote from: Thijn on Oct 21, 2015, 05:20 PMQuote from: KAKAN on Oct 21, 2015, 04:01 PMI know, but he's a beginner.
So we can't give a decent answer because he wont understand it? How's he gonna learn from it then?
yes you are right thijin
Quote from: Spidey on Oct 22, 2015, 07:37 AMQuote from: Thijn on Oct 21, 2015, 05:20 PMQuote from: KAKAN on Oct 21, 2015, 04:01 PMI know, but he's a beginner.
So we can't give a decent answer because he wont understand it? How's he gonna learn from it then?
yes you are right thijin
Was he ever wrong :P?
Don't be angry. I was about to have some fun since I'm getting bored in my trip
Be normal all. Don't spam here on my topice
For god sake, then why don't you lock it :P?
Its give this error.
@S.L.C[WEAPONS] No custom weapons to load.
[VEHICLEMODELS] No custom vehicle models to load.
announcer: Failed to announce to master.vc-mp.org; failed to lookup host address (0, The operation completed successfully. )
[MODULE] Loaded SqVCMP 0.4 frontend by Stormeus. (v1.0)
scripts/Main.nut line = (900) column = (2) : error expression expected
[WARNING] Could not load script 'scripts/Main.nut'
[WARNING] expression expected
[ERROR] No Squirrel gamemode was specified.
Quote from: KAKAN on Oct 22, 2015, 01:22 PMFor god sake, then why don't you lock it :P?
i can't understand KAKAN WHat you mean!!!!!
Show us line # 900
and i think you didnt copy paste correctly its works perfect for me
Expression Expected occurs in conditions mentioned below
Condition 1: when we remove an requierd bracket.
onPlayerJoin(player)
{
if(player)
{
MessagePlayer("welcome",player);
}
// and we forgot to put or remove an bracket from here
Condition 2: when put extra bracket
onPlayerJoin(player)
{
if(player)
{
MessagePlayer("welcome",player);
}
}
}// by mistakenly put extra bracket
But in both condition the result will be
[expression expected]
It was just an little explaination
Also expression expected can occur on something like this but it'll tell lines etc
try
{
whatever();
}
print ("hey dudes"); //we put a print statement between try/catch block
catch (ex) {}
and on
player.Health = 0%; //lol that %
What was the need of it,
@Crys?
He would just post that.
@Topic creator.
Just look at the line 900.
Check for an extra/less bracket.
If yes, then just remove it,
Else post your whole code here.
Guys Solved i get codes thanks all for there feed back.