13.11.2009, 15:09
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;
}

