key binder
#1

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

I thing to create an Timer and an KillTimer
Reply
#3

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

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
Reply
#5

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?
Reply
#6

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

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)