SA-MP Forums Archive
Please wait 1 second before submmiting the command again! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please wait 1 second before submmiting the command again! (/showthread.php?tid=480711)



Please wait 1 second before submmiting the command again! - SplinteX - 12.12.2013

Hello!

Can someone give me some plugin/filterscript for this,you have to wait 1 sec before typing another command after the command you typed before in chat:



Sorry for bad english.


Re: Please wait 1 second before submmiting the command again! - RedCountyRP - 12.12.2013

Hello there. Try reading this topic and see if you can find an answer to your question. https://sampforum.blast.hk/showthread.php?tid=354077


Re: Please wait 1 second before submmiting the command again! - newbie scripter - 12.12.2013

Here is what u want, just click me


Re: Please wait 1 second before submmiting the command again! - StuartD - 12.12.2013

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
This is for Vehicle Speed, not chat spam.


Re: Please wait 1 second before submmiting the command again! - SplinteX - 12.12.2013

Quote:
Originally Posted by RedCountyRP
Посмотреть сообщение
Hello there. Try reading this topic and see if you can find an answer to your question. https://sampforum.blast.hk/showthread.php?tid=354077
Thats great,but look,here is my big proble.I am totally newbie at scripting and all of this stuff,I am just planning to open new server.So if someone would put this in .pwn file and if someone could tell me where to put this .pwn file,to filterscripts file,OR?

Thanks in advance !


Re: Please wait 1 second before submmiting the command again! - SplinteX - 13.12.2013

So,can anyone help me?Read my previous post.


Re: Please wait 1 second before submmiting the command again! - xVIP3Rx - 13.12.2013

Do you use ZCMD ?


Re: Please wait 1 second before submmiting the command again! - BigGroter - 13.12.2013

Try this, I haven't used PAWN in ages though. I think this should work if you use ZCMD.

pawn Код:
//at the top.
new canUse[playerid] == true;


//Somewhere in your script, under your "CMD:"s eg.
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(canUse[playerid] == false)
    {
        SendClientMessage(playerid, -1, "Please wait a second before submitting another command!");
        return 0;
    }
    else
    {
         canUse[playerid] = false;
         SetTimerEx("commandTimer", 1000, false, "d", playerid);
    }
    return 1;
}


//Somewhere in the script, bottom eg.
forward commandTimer(playerid);
public commandTimer(playerid)
{
    canUse[playerid] = true;
    return 1;
}



Re: Please wait 1 second before submmiting the command again! - nmader - 13.12.2013

Quote:
Originally Posted by BigGroter
Посмотреть сообщение
Try this, I haven't used PAWN in ages though. I think this should work if you use ZCMD.

pawn Код:
//at the top.
new canUse[playerid] == true;


//Somewhere in your script, under your "CMD:"s eg.
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(canUse[playerid] == false)
    {
        SendClientMessage(playerid, -1, "Please wait a second before submitting another command!");
        return 0;
    }
    else
    {
         canUse[playerid] = false;
         SetTimerEx("commandTimer", 1000, false, "d", playerid);
    }
    return 1;
}


//Somewhere in the script, bottom eg.
forward commandTimer(playerid);
public commandTimer(playerid)
{
    canUse[playerid] = true;
    return 1;
}
Perhaps you should explain the code as the original poster stated they were new to scripting? Handing a newbie a block or code only encourages them to steal the code and have others do it for them.


Re: Please wait 1 second before submmiting the command again! - BigGroter - 13.12.2013

He stated that he just wanted to copy and paste. His server is going to be dead in a couple of days anyway, hopefully someone else can benefit from the code. If you want to explain the code, feel free to, I can't be arsed at the moment.