19.07.2013, 15:28
I want the life to go up 1hp each 5 seconds here is the command
pawn Код:
CMD:td(playerid,params[])
{
new amount;
if(sscanf(params, "d", amount)) return SendClientMessage(playerid, -1, "USAGE: /td [amount]");
if(0 < amount <= PlayerInfo[playerid][drugs])
{
new Float:Health;
GetPlayerHealth(playerid, Health);
SetPlayerHealth(playerid, Health+10);
PlayerInfo[playerid][drugs] -= amount;
SetTimerEx("Usedrugs", 2500*amount, false, "d", playerid); // 2 SECONDS IN REAL LIFE
new string[ 128 ];
format(string, sizeof(string), "You are smoking %d gram(s).", amount);
SendClientMessage(playerid, -1, string);
}
else
{
SendClientMessage(playerid, -1, "You don't have enough drugs.");
}
return 1;
}