Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - General

Pages: 1 ... 121 122 123 124 125 [126] 127 128 129 130 131
1876
Modification Help / Re: Flood Protection
« on: July 26, 2010, 05:37:52 PM »
Quark and I recently found out another way we could find if the client is under flood protection, and it worked!
Code: [Select]
package TEST
{
function serverCmdMessageSent(%client, %text)
{
%time = getSimTime();
        %spamTime = %client.spamProtectStart;
        if(%time - %spamTime < 10000 || %text $= %client.lastMsgSent && !%client.isAdmin)
{
cancel(%client.lastMsgSentSchedule);
%client.lastMsgSentSchedule = schedule(15000,0,eval,%client @ ".lastMsgSent = '';");
}
else
        {
//code goes here
}
%client.lastMsgSent = %text;
parent::serverCmdMessageSent(%client, %text);
}
};
activatepackage(TEST);

Reguardless, thank you all for your help.

1877
So, what do I change the datablock names to?

It's too hard to explain fully what to do, have you received my PM? Is there a problem?

1878
Modification Help / Re: Flood Protection
« on: July 26, 2010, 04:14:56 AM »
that's all i can say, since i have no clue what the overall attempt here is.
It seems I haven't made myself clear enough?

My overall attempt is to make a script which checks that the client is not under flood protection before continuing with the main code, for example: If somebody says "What are the rules?" The rules will appear in the message hud, but if the client is under flood protection it will ignore it.

I can't possibly make myself clearer?

1879
Modification Help / Re: Flood Protection
« on: July 25, 2010, 04:16:48 PM »
Still need help...

1880
Modification Help / Re: Edited ButterflyKnife Not Showing Up In-Game?
« on: July 25, 2010, 12:49:09 PM »
Could you please post the code of both the Rank 4 and 5 knifes?

EDIT: Just PM them to me, and please stop making more topics on this.

1881
Modification Help / Re: Edited ButterflyKnife Not Showing Up In-Game?
« on: July 25, 2010, 02:57:03 AM »
I can't help much if you don't post the script, but I guess that this could be because both datablocks of the knives are named the same, check their names and change them if they are.

1882
Modification Help / Re: Flood Protection
« on: July 24, 2010, 05:13:24 PM »
So, it activates their flood protection?
The echo proved that it has values, it also proved that 1 means the client is under flood protection, you could try this yourself. After finding that it has values, I tried to use it in my script which failed. Basically, I wanted it to continue the code if the client was not under flood protection, instead it resulted in giving me two flood warnings and continued running the code:
Code: [Select]
package TEST
{
     function serverCmdMessageSent(%client, %text)
     {
          if(spamAlert(%client) == 0)
          {
               //Code goes here
          }
          parent::serverCmdMessageSent(%client, %text);
     }
};
activatePackage(TEST);
The echo said yes, it does activate their flood protection. It doesn't seem that way in the code, unless I've made a mistake in it? I need some clarification on this, this is how I'm presuming it works.


this seems pointless imo...

maybe if i knew what you were actually trying to do here...
Maybe re-reading the posts will help, I've left enough information on what I am trying to do.

1883
Modification Help / Re: Flood Protection
« on: July 24, 2010, 01:04:16 PM »
Is spamAlert actually turning on their 10-second period of inability to talk?
I think so, since the value is 1 for 10 seconds.

1884
Modification Help / Re: Flood Protection
« on: July 24, 2010, 01:00:57 PM »
Strange though Kalphiter, that if I type "echo(spamAlert(findClientByName(General)));" in the console it returns a value of 0, or 1 if I'm in flood protection.

1885
Modification Help / Re: Flood Protection
« on: July 24, 2010, 12:31:56 PM »
You don't know what you're doing.
spamAlert() is just meant to turn their flood protection on, and its not supposed to be a value.
Okay, so is there another way to do this?

1886
Modification Help / Re: Flood Protection
« on: July 24, 2010, 12:28:41 PM »
if(%cake)
{
  echo("oh hey look cake");
}
else
{
  echo("oh thats disappointing");
}
I've tried that, as I mentioned in the main post...

EDIT: What I ment is how can you "else" a function like "function spamAlert(%client)"

1887
Modification Help / Re: Flood Protection
« on: July 24, 2010, 12:22:30 PM »
package the function spamAlert and add stuff to do when it's called

if you don't get how to do this, then ask around more
I know what you mean, but how can you "else" a function?

1888
Modification Help / Re: Flood Protection
« on: July 24, 2010, 11:53:59 AM »
what is the overall use for what you are trying to do here?..
If a client says something like "What are the rules?" and is in flood protection, then the rules won't appear.
Why should you need so much info anyways? Haven't I clearly stated what I wanted?

1889
Modification Help / Re: Flood Protection
« on: July 24, 2010, 11:30:15 AM »
packaging?
Yes, it's packaged.

EDIT: The code is just a prototype... I refer to my main post.

1890
Modification Help / Flood Protection
« on: July 24, 2010, 08:26:47 AM »
I've been studying how flood protection works because I want to use it for one of my scripts. I've found that "spamAlert(%client)" calls the function, am I right? However this is not what I need, I want to check whether the function is called... I've tried "if(spamAlert(%client))" but ignores "if()" and just calls the function. Is there a way I could do this? Thanks.

Pages: 1 ... 121 122 123 124 125 [126] 127 128 129 130 131