14.07.2013, 15:57
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);
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;
}
Lets say I take /td 1 its ment to put my health going up slowly for about 30 milli seconds but on the other hand if I do /td 10 its ment to let my health carry on going for about 3 seconds in real life...