Timer on command
#20

You don't have to make ANY timers.

pawn Код:
new CmdDelay[MAX_PLAYERS];

//OnPlayerCommandText
if (strcmp("/bayonet", cmdtext, true, 8) == 0)
{
  if (CmdDelay[playerid]<GetTickCount())
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "You have successfully reloaded your bayonet");
    SendClientMessage(playerid, 0xAAAAAAAA, "(( You may only use the bayonet each every six seconds (takes 6sec to reload). ))");
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 33, 1);
    CmdDelay[playerid] = GetTickCount()+6000; //6000 = 6 seconds
  }
  return 1;
}

and FYI, a 'bayonet' is a knife that goes onto the end of a rifle for stabbing people.
Reply


Messages In This Thread
Timer on command - by Galcio - 24.02.2010, 10:24
Re: Timer on command - by aircombat - 24.02.2010, 10:36
Re: Timer on command - by GaGlets(R) - 24.02.2010, 10:44
Re: Timer on command - by Galcio - 24.02.2010, 11:00
Re: Timer on command - by Razvann - 24.02.2010, 11:02
Re: Timer on command - by Galcio - 24.02.2010, 11:06
Re: Timer on command - by VonLeeuwen - 24.02.2010, 11:07
Re: Timer on command - by MenaceX^ - 24.02.2010, 11:11
Re: Timer on command - by VonLeeuwen - 24.02.2010, 11:13
Re: Timer on command - by Galcio - 24.02.2010, 11:17
Re: Timer on command - by VonLeeuwen - 24.02.2010, 11:18
Re: Timer on command - by Gamer_Z - 24.02.2010, 11:43
Re: Timer on command - by GaGlets(R) - 24.02.2010, 11:46
Re: Timer on command - by Gamer_Z - 24.02.2010, 12:37
Re: Timer on command - by VonLeeuwen - 24.02.2010, 12:40
Re: Timer on command - by Galcio - 24.02.2010, 15:22
Re: Timer on command - by Galcio - 24.02.2010, 16:21
Re: Timer on command - by GaGlets(R) - 24.02.2010, 16:35
Re: Timer on command - by Galcio - 24.02.2010, 16:47
Re: Timer on command - by Joe Staff - 24.02.2010, 17:11
Re: Timer on command - by Galcio - 24.02.2010, 17:26
Re: Timer on command - by Gamer_Z - 25.02.2010, 05:42

Forum Jump:


Users browsing this thread: 2 Guest(s)