How can i make the players addicted?
#1

Hello, some time ago i made it so if you smoke more than the choosen ammount of cigarettes you get cancer wich will slowly drain your health.. Well now i want to make it so if you smoke over example 20 cigarettes you become addicted and after a while if you dont smoke the screen will be weird or something. But what im wondering is.. Can i use timers for that? And then kill the timer when i use /smoke again so the timer restarts or will the timer stop and nothing more will happen after that?
Reply
#2

yes you can use timer to check if the player is addicted or not
Reply
#3

So i with the killtimer thing i will only restart it? I mean so it will work again after lets say 1 hour
Reply
#4

SetTimer
SetTimerEx
for info
Reply
#5

You can make a timer of 1 hour. And when 1 hour had happened check if the player has X of a variable and then if for example the player has 100 of 'X' variable put some functions to the player and the timer must be in 'true'. And i don't know, if the player smokes a cigarette the variable will go down.
Reply
#6

would this work for example?
pawn Код:
if(strcmp(cmd, "/command", true) == 0)
    {
        KillTimer(addictedtimer[playerid]);
        SetTimerEx("addictedtimer", 1000, 1, "i", playerid);
cuz as i understood it the killtimer wont restart the timer but stop it compleatly so if i kill the timer and then start it again with the same command would that work?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)