Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: HaCkeR0o1 on Oct 21, 2015, 01:46 PM

Title: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 21, 2015, 01:46 PM
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.
Title: Re: Need sSomeTHing
Post by: . on Oct 21, 2015, 01:54 PM
F*ING DEFINE SPAM!!!
Title: Re: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 21, 2015, 01:56 PM
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.
Title: Re: Need sSomeTHing
Post by: . on Oct 21, 2015, 02:15 PM
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();
    }
}
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 21, 2015, 03:51 PM
He won't understand that.
Title: Re: Need sSomeTHing
Post by: . on Oct 21, 2015, 03:53 PM
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.
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 21, 2015, 04:01 PM
I know, but he's a beginner.
Title: Re: Need sSomeTHing
Post by: Thijn on Oct 21, 2015, 05:20 PM
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?
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 21, 2015, 05:40 PM
Okay sorry.
Title: Re: Need sSomeTHing
Post by: Spidey on Oct 22, 2015, 07:37 AM
Quote from: Thijn on Oct 21, 2015, 05:20 PM
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?

yes you are right thijin
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 22, 2015, 11:22 AM
Quote from: Spidey on Oct 22, 2015, 07:37 AM
Quote from: Thijn on Oct 21, 2015, 05:20 PM
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?

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
Title: Re: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 22, 2015, 12:27 PM
Be normal all. Don't spam here on my topice
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 22, 2015, 01:22 PM
For god sake, then why don't you lock it :P?
Title: Re: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 22, 2015, 01:31 PM
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.
Title: Re: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 22, 2015, 01:31 PM
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!!!!!
Title: Re: Need sSomeTHing
Post by: :P on Oct 22, 2015, 02:06 PM
Show us line # 900
and i think you didnt copy paste correctly its works perfect for me
Title: Re: Need sSomeTHing
Post by: MacTavish on Oct 22, 2015, 03:03 PM
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
Title: Re: Need sSomeTHing
Post by: EK.IceFlake on Oct 22, 2015, 04:17 PM
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 %
Title: Re: Need sSomeTHing
Post by: KAKAN on Oct 23, 2015, 04:38 PM
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.
Title: Re: Need sSomeTHing
Post by: HaCkeR0o1 on Oct 25, 2015, 11:05 AM
Guys Solved i get codes thanks all for there feed back.