SA-MP Forums Archive
Drugs problem - 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 problem (/showthread.php?tid=439676)



Drugs problem - [..MonTaNa..] - 26.05.2013

Removed.


Re: Drugs problem - [..MonTaNa..] - 27.05.2013

Bump


Re: Drugs problem - AIped - 27.05.2013

there should be something wrong with the timer for the drugs effect. Try to shut that down to test if the bug still excists


Re: Drugs problem - [..MonTaNa..] - 27.05.2013

Removed.


Re: Drugs problem - Hernando - 27.05.2013

No, he meant inside of the timer. Show us the function "DrugsE" (look for "public DrugsE")


Re: Drugs problem - CmZxC - 27.05.2013

DrugsE is shown already.

swap this
pawn Код:
DrugTimer[playerid] = SetTimerEx("DrugsE", 1300, 1, "ii", playerid, amount);
with this
pawn Код:
DrugTimer[playerid] = SetTimerEx("DrugsE", 1300, 0, "ii", playerid, amount);
should do the trick, you had it on repeating.


Re: Drugs problem - Hernando - 27.05.2013

DrugsE is not already shown. The timer set to play that function is. But he probably doesn't have a check to see if the player's health is 100 or higher, and to then reset it back to 100.


Re: Drugs problem - CmZxC - 27.05.2013

Quote:
Originally Posted by Hernando
Посмотреть сообщение
DrugsE is not already shown. The timer set to play that function is. But he probably doesn't have a check to see if the player's health is 100 or higher, and to then reset it back to 100.
IT IS SHOWN. do you bother scrolling down his code?

pawn Код:
public DrugsE(playerid,amount)
{
    new Float:hZ;
    busyAnim[playerid] = false;
    GetPlayerHealth(playerid,hZ);
    Deffect[playerid]++;
    SetPlayerHealth(playerid,hZ+2);
    if(hZ > 100.0) SetPlayerHealth(playerid, 100.0);
    if(Deffect[playerid] >= amount) return KillTimer(DrugTimer[playerid]);
    return 1;
}



Re: Drugs problem - [..MonTaNa..] - 27.05.2013

Removed.