help ?
#1

how can i make a protection on the word
kwakbox
like
that i can use the word 1 time in 5 minutes
so is type
kwakbox
and i want to type it a gain
it says < You already sayed kwakbox wait 5 minutes >
Reply
#2

Don't really know how efficient this is but ought to work (not tested):

Код:
new StopKwak[MAX_PLAYERS]; //at the top of your script
forward AllowKwak(playerid);
Код:
OnPlayerText(playerid, text[])
{
     if(!strcmp(text, "kwakbox",false, 7))
     {
         if(StopKwak[playerid] == 0)
         {
               StopKwak[playerid] = 1;
               SetTimerEx("AllowKwak", 300000, false, "i", playerid);
         }
         else
         {
               SendClientMessage(playerid, 0xFF0000, "Please wait 5 minutes before saying kwakbox again!");
               return 0;
         }
      }
      return 1;
}
Код:
public AllowKwak(playerid) //anywhere in your script
{
     StopKwak[playerid] = 0;
}
Reply
#3

thanks that works
my bot dousnt responds on it
Reply
#4

Quote:
Originally Posted by tim1120
thanks that works
my bot dousnt responds on it
If it does not show your text, copy the following and re-paste it were you had before.. DO NOT CHANGE ANYTHING ELSE, EXCEPT THIS....

pawn Код:
OnPlayerText(playerid, text[])
{
     if(!strcmp(text, "kwakbox",false, 7))
     {
         if(StopKwak[playerid] == 0)
         {
               StopKwak[playerid] = 1;
               SetTimerEx("AllowKwak", 300000, false, "i", playerid);
         }
         else
         {
               SendClientMessageToPlayer(playerid, 0xFF0000, "Please wait 5 minutes before saying kwakbox again!");
               return 0;
         }
      }
      return 1;
}
Your actually changing,
Код:
SendClientMessage
to this..
.
Код:
SendClientMessageToPlayer
Which this is actually gonna send the Player who said "Kwakbox", the message saying "Please wait 5 minutes before saying kwakbox again!"
Reply
#5

Quote:
Originally Posted by tim1120
my bot dousnt responds on it
What do you mean by that? Does it work or doesn't it...

Quote:
Originally Posted by tim1120
Your actually changing,
Код:
SendClientMessage
to this..
.
Код:
SendClientMessageToPlayer
Which this is actually gonna send the Player who said "Kwakbox", the message saying "Please wait 5 minutes before saying kwakbox again!"
Not true, SendClientMessage sends a message to a particular player, while SendClientMessageToAll sends a message to all the players in the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)