21.01.2010, 01:44
Hello :P Got a little problem in this code, but first an explanation of how it works
There is a timer that checks if a player is on drugs every 250miliseconds, if the player is on drugs then it checks what kind of drug is it, if it's weed, it-s supposed to heal the player, somehow it-s not working with a different ID than 0.. and Im not using playerid
also the smoking effect goes off for no reason, and i guess thats the problem but i dont see why... and if there is no smoking effect there wont be any healing.
how can i prevent the smoking effect from going off and that when player presses enter and the special action dissapears, the drug effect stops too
ps the effect lasts about 40 seconds with the timer speed.
There is a timer that checks if a player is on drugs every 250miliseconds, if the player is on drugs then it checks what kind of drug is it, if it's weed, it-s supposed to heal the player, somehow it-s not working with a different ID than 0.. and Im not using playerid
also the smoking effect goes off for no reason, and i guess thats the problem but i dont see why... and if there is no smoking effect there wont be any healing.
how can i prevent the smoking effect from going off and that when player presses enter and the special action dissapears, the drug effect stops too
ps the effect lasts about 40 seconds with the timer speed.
Код:
if (OnWeed[stonedplayer]==1){ if (GetPlayerSpecialAction(stonedplayer)!= SPECIAL_ACTION_SMOKE_CIGGY){ OnWeed[stonedplayer]=0; OnDrugs[stonedplayer]=0; SetPlayerDrunkLevel(stonedplayer,0); SetPlayerWeather(stonedplayer, 1); }else pxplyr[stonedplayer]=pxplyr[stonedplayer]+1; if (pxplyr[stonedplayer]>=220){ OnWeed[stonedplayer]=0; OnDrugs[stonedplayer]=0; SetPlayerDrunkLevel(stonedplayer,0); SetPlayerWeather(stonedplayer, 33); SetPlayerSpecialAction(stonedplayer,0); } else if (pxplyr[stonedplayer]<=220){ new Float: phealth; GetPlayerHealth(stonedplayer,phealth); phealth = phealth+1; if ( phealth < 80 ){ SetPlayerHealth(stonedplayer,phealth); } } }