SA-MP Forums Archive
key binder - 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: key binder (/showthread.php?tid=578081)



key binder - keyvanik - 16.06.2015

Hi how to make a untispam for key binder program mute or kick who use it


Re: key binder - arlindi - 16.06.2015

I thing to create an Timer and an KillTimer


Re: key binder - keyvanik - 16.06.2015

Quote:
Originally Posted by arlindi
Посмотреть сообщение
I thing to create an Timer and an KillTimer
Create a Timer for all cmds?


Re: key binder - DarkLored - 16.06.2015

Quote:
Originally Posted by arlindi
Посмотреть сообщение
I thing to create an Timer and an KillTimer
You shouldn't post solution that are unreliable because you "think"

OT: You could use a variable or an enum to store if the player is muted or not and then use OnPlayerText to not allow the player to speak.

for example
pawn Код:
new muted[MAX_PLAYERS]; //on top of the script

CMD:muteplayer(playerid, param[])
{
       new ID;
       if(sscanf(params, "%u", ID))
       {
          //code here
           retrun 1;
       }
       muted[ID] = 1;
      return 1;
}

and in on player text write this

if(muted[playerid] == 1)
{
    SendClientMessage(playerid, -1, "You are muted");
    return 0;
}

//remember to return 0 OnPlayerText so it'll work



Re: key binder - keyvanik - 16.06.2015

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
You shouldn't post solution that are unreliable because you "think"

OT: You could use a variable or an enum to store if the player is muted or not and then use OnPlayerText to not allow the player to speak.

for example
pawn Код:
new muted[MAX_PLAYERS]; //on top of the script

CMD:muteplayer(playerid, param[])
{
       new ID;
       if(sscanf(params, "%u", ID))
       {
          //code here
           retrun 1;
       }
       muted[ID] = 1;
      return 1;
}

and in on player text write this

if(muted[playerid] == 1)
{
    SendClientMessage(playerid, -1, "You are muted");
    return 0;
}

//remember to return 0 OnPlayerText so it'll work
this cmd for mute player or mute auto?


Re: key binder - [XST]O_x - 16.06.2015

https://www.******.com/#q=sa-mp+antispam


Re: key binder - Stanford - 16.06.2015

Use a bool variable and set it true and off.
The technique is whenever the player uses keybinder you set it to true and you use SetTimerEx after x milliseconds you set it to false. Inside the dialog/command whatever check if the bool is true if it's true send a message to the player saying you can't spam or return 0.

I hope I helped any feedback is appreciated!