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

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

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

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

Помогите с наркозависимостью!

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

Androns

Ученик
Помогите!Дело в том что когда игрок употре***ет наркотики находясь на сервере зависимость прибавляется!После перезахода она равна 0!В БД Enum есть!Вот команда!

PHP:
else if(strcmp(cmd, "/usedrugs", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			tmp = strcharsplit(cmdtext, idx);
			if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /usedrugs [количество]");
			new Float:health;
			new ammount = strval(tmp);
			tmp = strcharsplit(cmdtext, idx);
			if(PlayerInfo[playerid][pDrugtime] > 0) return  SendClientMessage(playerid,COLOR_GRAD1,"{FF0000}x {AFAFAF}Нельзя слишком часто употре***ть наркотик!");
			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 грамм!"); }
			if(PlayerInfo[playerid][pDrugs] <= 0) return SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}x {AFAFAF}Недостаточно наркотиков");
			PlayerInfo[playerid][pDrugtime] = 10;
			if(PlayerInfo[playerid][pDrugs] >= ammount)
			{
				if(PlayerInfo[playerid][pNarcoZavisimost] <= 4000) { SetPlayerWeather(playerid, -68); SetPlayerTime(playerid,17,0); PlayerStoned[playerid] = 0; }
				if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {    PlayerStoned[playerid] += 1; if(PlayerCuffed[playerid] == 0) { ApplyAnimation(playerid,"SMOKING","M_smk_drag",4.1,0,0,0,0,0,1);    } }
				if(ammount == 1) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 10.0); }
				if(ammount == 2) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 20.0); }
				if(ammount == 3) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 30.0); }
				if(ammount == 4) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 40.0); }
				if(ammount == 5) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 50.0); }
				if(ammount == 6) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 60.0); }
				if(ammount == 7) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 70.0); }
				if(ammount == 8) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 80.0); }
				if(ammount == 9) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 90.0); }
				if(ammount == 10) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 100.0); }
				if(ammount == 11) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 110.0); }
				if(ammount == 12) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 120.0); }
				if(ammount == 13) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 130.0); }
				if(ammount == 14) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 140.0); }
				if(ammount == 15) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, health + 150.0); }
				if(PlayerInfo[playerid][pNarcoZavisimost] < 2000) {    if(PlayerHealth[playerid] >= 120) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, 120.0);      } }
				if(PlayerInfo[playerid][pNarcoZavisimost] >= 2000 && PlayerInfo[playerid][pNarcoZavisimost] <= 2999) {    if(PlayerHealth[playerid] >= 130) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, 130.0);     } }
				if(PlayerInfo[playerid][pNarcoZavisimost] >= 3000 && PlayerInfo[playerid][pNarcoZavisimost] <= 3999) {    if(PlayerHealth[playerid] >= 140) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, 140.0);    } }
				if(PlayerInfo[playerid][pNarcoZavisimost] >= 4000 && PlayerInfo[playerid][pNarcoZavisimost] <= 4999) {    if(PlayerHealth[playerid] >= 150) { GetPlayerHealth(playerid, health); SetPlayerHealthAC(playerid, 150.0);    } }
				if(PlayerInfo[playerid][pNarcoZavisimost] >= 5000) {    if(PlayerHealth[playerid] >= 160) { PlayerHealth[playerid] = 160; SetPlayerHealthAC(playerid, 160.0);    } }
				PlayerInfo[playerid][pDrugs] -= ammount;
				PlayerInfo[playerid][pNarcoZavisimost] += ammount*2;
				usegrugss[playerid] = 1;
				SendMes(playerid,COLOR_WHITE,"(( Здоровье пополнено до: %0.0f ))", PlayerHealth[playerid]);
				format(stringer, sizeof(stringer), "%s употребил(а) наркотик", PlayerInfo[playerid][pNames]);
				ProxDetector(10.0, playerid, stringer, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				narkotimer = SetTimerEx( "NarkoTimer", 10000 , false, "i", playerid);
				tmphourtimer = SetTimerEx( "TmphourTimer", 10000 , false, "i", playerid);
				if(startnarko[playerid] == 1)
				{
					startnarko[playerid] = 0;
					if(PlayerCuffed[playerid] == 0) {      ApplyAnimation(playerid,"SMOKING","M_smk_drag",4.1,0,0,0,0,0,1); }
					send[playerid] = 0;
				}
			}
		}
		return true;
	}
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу