SA-MP Forums Archive
Drugs not function properly argh! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Drugs not function properly argh! (/showthread.php?tid=450765)



Drugs not function properly argh! - RandomDude - 14.07.2013

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;
}
What its ment to do is...
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...


Re: Drugs not function properly argh! - RandomDude - 14.07.2013

Like I want it to go +5 each second...


Re: Drugs not function properly argh! - RandomDude - 17.07.2013

Anyone?