Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: NE.Restricted on August 16, 2014, 03:45:37 pm
-
In pawn, you cannot pass arguments using a timer.
Or can you!
To make a timed heal system requires some variables:
new IsHealing[100];
new HealCount[100];
Some definitions
#define HEAL_HEALTH_AMOUNT 100 //the amount of heal you wanna give after healing
#define HEAL_TIME_SECONDS 10 //the time you want to take to heal in seconds
And a timer, ofcourse
public OnGameModeInit()
{
NewTimer("Healed", 1000, 1);
}
And the timed function
public Healed()
{
for(new i; i<=100; i++)
{
if(IsHealing[i]==1)
{
HealCount[i]++;
if(HealCount[i]== HEAL_TIME_SECONDS)
{
IsHealing[i] = 0;
SetPlayerHealth(i, HEAL_HEALTH_AMOUNT);
}
}
}
}
and where you want to make the heal (example !heal)
IsHealing[playerid] = 1;
HealCount[playerid] = 0;
-
Go hear http://nybsr.createaforum.com/fast-showroom/heal-in-5-sec/
-
Go hear http://nybsr.createaforum.com/fast-showroom/heal-in-5-sec/
Bugged!
This will healed ID 0 while the player wrote !heal wonder why he frozen and frozen and not unfreeze!