Need Help
#5

It's a very tricky question :P

How is it possible to get the command entered 3 times in a row.MMMMMMMMMM

I know
Take these three commands for eg:
Код:
new bool:firstcmd[MAX_PLAYERS];
new helpcmd[MAX_PLAYERS];
new mecmd[MAX_PLAYERS];
new killcmd[MAX_PLAYERS];
Under OnPlayerConnect
Код:
firstcmd[playerid]=true;
OnPlayerCommandText

Код:
if(!strcmp(cmdtext,"/help",5,true))
{
  if(firstcmd[playerid]==true)
  {
    firstcmd[playerid]=false;
    helpcmd[playerid]++;
  }
  else helpcmd++;
  killcmd[playerid]=0;
  mecmd[playerid]=0;

//your helpcode

  if(helpcmd[playerid]>3)
  {
    Kick(playerid);
  }
  return 1;
}

if(!strcmp(cmdtext,"/me",3,true))
{
  if(firstcmd[playerid]==true)
  {
    firstcmd[playerid]=false;
    mecmd[playerid]++;
  }
  else mecmd[playerid]++;
  killcmd[playerid]=0;
  helpcmd[playerid]=0;
  //your me code
  if(mecmd[playerid]>3)
  {
    Kick(playerid);
  }

  return 1;
}

if(!strcmp(cmdtext,"/kill",5,true))
{
  if(firstcmd[playerid]==true)
  {
    firstcmd[playerid]=false;
    killcmd[playerid]++;
  }
  else killcmd[playerid]++;
  mecmd[playerid]=0;
  helpcmd[playerid]=0;

//your kill code

  if(killcmd[playerid]>3)
  {
    Kick(playerid);
  }

  return 1;
}
How about that?
Reply


Messages In This Thread
Need Help - by xinix000 - 09.06.2010, 11:12
Re: Need Help - by DJDhan - 09.06.2010, 11:20
Re: Need Help - by Maxips2 - 09.06.2010, 11:26
Re: Need Help - by Ignas1337 - 09.06.2010, 12:49
Re: Need Help - by DJDhan - 09.06.2010, 13:04
Re: Need Help - by xinix000 - 09.06.2010, 15:01
Re: Need Help - by DJDhan - 09.06.2010, 15:09

Forum Jump:


Users browsing this thread: 2 Guest(s)