#2

pawn Код:
new RandomHP[] = {10, 20, 30, 40};

rand = random(sizeof(RandomHP));
/*this will make a random number from 0 to the arrays size which is in this case 4
the possible numbers which can be generated are 0, 1, 2 and 3*/

SetPlayerHealth(playerid,RandomHP[rand]);
pawn Код:
new CmdLock[MAX_PLAYERS];
dcmd_hme(playerid, params[])
{
  if(CmdLock[playerid] == 1)
  {
    SendClientMessage(playerid, color, "Don't use the heal command to often!");
    return 1;
  }
  //heal player and stuff
  CmdLock[playerid] = 1;
  SetTimerEx("HealCmdLock", 1000, false, "d", playerid);
  return 1;
}

forward HealCmdLock(playerid);
public HealCmdLock(playerid)
{
  CmdLock[playerid] = 0;
}
Reply


Messages In This Thread
/hme - by Lajko1 - 13.11.2009, 15:02
Re: /hme - by dice7 - 13.11.2009, 15:09
Re: /hme - by Lajko1 - 13.11.2009, 15:53
Re: /hme - by Lajko1 - 13.11.2009, 16:04
Re: /hme - by Rzzr - 13.11.2009, 16:16
Re: /hme - by Lajko1 - 14.11.2009, 07:22
Re: /hme - by BP13 - 14.11.2009, 07:25
Re: /hme - by Lajko1 - 14.11.2009, 07:28
Re: /hme - by dice7 - 14.11.2009, 07:32
Re: /hme - by BP13 - 14.11.2009, 07:34

Forum Jump:


Users browsing this thread: 1 Guest(s)