Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Таймер наркотиков

Статус
В этой теме нельзя размещать новые ответы.

Steve KIng

Новичок
Проблема в том, что при употребление наркоты эфект не пропадает, вот как таймер поставить на 30 секунд я не знаю, помогите, с меня +
PHP:
if(strcmp(cmd, "/usedrugs", true) == 0)
	{
 		if(IsPlayerConnected(playerid))
   		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "{8080ff}Ââåäèòå: {ffffff}/usedrugs [êîë-âî]");
				return true;
			}
			new ammount;
			ammount = strval(tmp);
			if(PlayerInfo[playerid][pDrugtime] > 0) return  SendClientMessage(playerid,COLOR_GRAD1,"Íåëüçÿ ñëèøêîì ÷àñòî óïîòðå***òü íàðêîòèê!");
			if(PlayerInfo[playerid][pNarcoZavisimost] <= 3000)
   			{
      			  if(ammount > 3 || ammount < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Íåëüçÿ ìåíüøå 1 ãðàììà è áîëüøå 3 ãðàìì!");
         	}
          	else if(PlayerInfo[playerid][pNarcoZavisimost] > 3000 && PlayerInfo[playerid][pNarcoZavisimost] <= 5000)
           	{
            	if(ammount > 12 || ammount < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Íåëüçÿ ìåíüøå 1 ãðàììà è áîëüøå 12 ãðàìì!");
            }
            else if(PlayerInfo[playerid][pNarcoZavisimost] > 5000)
            {
            	if(ammount > 15 || ammount < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Íåëüçÿ ìåíüøå 1 ãðàììà è áîëüøå 15 ãðàìì!");
            }
			PlayerInfo[playerid][pDrugtime] = 20;
			new Float:health = PlayerInfo[playerid][pHP];
			new healhp = PlayerInfo[playerid][pHP];
			GetPlayerHealth(playerid, health);
			if(PlayerInfo[playerid][pDrugs] >= ammount)
			{
   				if(PlayerInfo[playerid][pHP] >= 160)
				{
    				SetPlayerWeather(playerid, -68);
					PlayerStoned[playerid] = 0;
				}
    			SetPlayerTime(playerid,17,0);
    			SetPlayerWeather(playerid, -68);
   				PlayerStoned[playerid] += 1;
			    ApplyAnimation(playerid,"SMOKING","M_smk_drag",4.1,0,0,0,0,0,1);
				if(ammount == 1)
				{
					SetPlayerHealthAC(playerid, health + 10.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 2)
				{
					SetPlayerHealthAC(playerid, health + 20.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 3)
				{
					SetPlayerHealthAC(playerid, health + 30.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 4)
				{
					SetPlayerHealthAC(playerid, health + 35.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 5)
				{
					SetPlayerHealthAC(playerid, health + 40.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 6)
				{
					SetPlayerHealthAC(playerid, health + 45.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 7)
				{
					SetPlayerHealthAC(playerid, health + 50.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 8)
				{
					SetPlayerHealthAC(playerid, health + 55.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 9)
				{
					SetPlayerHealthAC(playerid, health + 60.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 10)
				{
					SetPlayerHealthAC(playerid, health + 65.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 11)
				{
					SetPlayerHealthAC(playerid, health + 70.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 12)
				{
					SetPlayerHealthAC(playerid, health + 75.0);
					GetPlayerHealth(playerid, health);
				}
				if(ammount == 13)
				{
					SetPlayerHealthAC(playerid, health + 80.0);
				}
				if(ammount == 14)
				{
					SetPlayerHealthAC(playerid, health + 85.0);
				}
				if(ammount == 15)
				{
					SetPlayerHealthAC(playerid, health + 90.0);
				}
				if(PlayerInfo[playerid][pHP] >= 160)
 				{
    				PlayerInfo[playerid][pHP] = 160;
				}
    			PlayerInfo[playerid][pDrugs] -= ammount;
			    PlayerInfo[playerid][pNarcoZavisimost] += ammount*2;
    			PlayerInfo[playerid][pKongfuSkill] -= ammount;
     			PlayerInfo[playerid][pBoxSkill] -= ammount;
     			PlayerInfo[playerid][pKickboxSkill] -= ammount;
	    		//SendMes(playerid, COLOR_GREEN, "Âû óïîòðåáèëè %d ãðàìì íàðêîòèêîâ",ammount);
				format(string, sizeof(string), "(( Çäîðîâüå ïîïîëíåíî äî: %d ))", healhp);
				SendClientMessage(playerid, COLOR_WHITE, string);
    			format(string, sizeof(string), "%s óïîòðåáèë(à) íàðêîòèêè", sendername);
			    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    if(startnarko[playerid] == 1)
				{
					startnarko[playerid] = 0;
					ApplyAnimation(playerid,"SMOKING","M_smk_drag",4.1,0,0,0,0,0,1);
					send[playerid] = 0;
				}
			}
			else
			{
   				SendClientMessage(playerid, COLOR_GRAD1, "{FF3200} ! {FEFEFE} - Íåäîñòàòî÷íî íàðêîòèêîâ");
			}
		}
		return true;
	}
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу