kepo989
Умник
HTML:
if(strcmp(cmd, "/usedrugs", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Введите: /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;
GetPlayerHealth(playerid,health);
format(string, sizeof(string), "(( Здоровье пополнено до: %d ))", health);
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);
narkotimer = SetTimerEx( "NarkoTimer", 20000 , false, "i", playerid);
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, "Недостаточно наркотиков");
}
}
return true;
}
