CMD:usecrack(playerid, params[])
{
if(UseDrugsTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"You must wait 5 seconds!");
if(PlayerCrackStoned[playerid] >= 5)
{
SendClientMessage(playerid, COLOR_RED, "You have used too much crack; therefore you have overdosed!");
SendClientMessage(playerid, COLOR_RED, "You must seek medical attention or you will die!");
SetTimerEx("Crackdeath", 10000, true, "i", playerid);
}
if(PlayerCrackStoned[playerid] >= 2)
{
GameTextForPlayer(playerid, "~w~You are~n~~p~Stoned", 4000, 1);
SetPlayerDrunkLevel(playerid, 15000);
SetPlayerWeather(playerid, 2009);
}
if(PlayerDrugInfo[playerid][pCrack] >= 1)
{
new Float:armor;
GetPlayerArmour(playerid, armor);
if(armor > 80) { SetPlayerArmour(playerid, 100.0); }
else { SetPlayerArmour(playerid, armor + 10.0); }
PlayerCrackStoned[playerid] += 1;
SendClientMessage(playerid, COLOR_BLUE, "You have used a gram of crack!");
UseDrugsTimer[playerid] = 1; PlayerDrugInfo[playerid][pCrack] -= 1;
SetTimerEx("UseDrugs",5*1000,0,"i",playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You don't have any crack left!");
}
return 1;
}
forward UseDrugs(playerid);
forward Crackdeath(playerid);
public UseDrugs(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(UseDrugsTimer[playerid])
{
UseDrugsTimer[playerid] = 0;
}
return 1;
}
public Crackdeath(playerid)
{
new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp-5);
}
CMD:healcrackoverdose(playerid, params[])
{
SetPlayerHealth(playerid, 100);
KillTimer();
return 1;
}
new PlayerCrackStoned[MAX_PLAYERS];
new UseDrugsTimer[MAX_PLAYERS];
PlayerCrackStoned[playerid] = 0;
UseDrugsTimer[playerid] = 0;
new CrackDeathTimer[MAX_PLAYERS];
CMD:usecrack(playerid, params[])
{
if(UseDrugsTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"You must wait 5 seconds!");
if(PlayerCrackStoned[playerid] >= 5)
{
SendClientMessage(playerid, COLOR_RED, "You have used too much crack; therefore you have overdosed!");
SendClientMessage(playerid, COLOR_RED, "You must seek medical attention or you will die!");
CrackDeathTimer[playerid] = SetTimerEx("Crackdeath", 10000, true, "i", playerid);
}
if(PlayerCrackStoned[playerid] >= 2)
{
GameTextForPlayer(playerid, "~w~You are~n~~p~Stoned", 4000, 1);
SetPlayerDrunkLevel(playerid, 15000);
SetPlayerWeather(playerid, 2009);
}
if(PlayerDrugInfo[playerid][pCrack] >= 1)
{
new Float:armor;
GetPlayerArmour(playerid, armor);
if(armor > 80) { SetPlayerArmour(playerid, 100.0); }
else { SetPlayerArmour(playerid, armor + 10.0); }
PlayerCrackStoned[playerid] += 1;
SendClientMessage(playerid, COLOR_BLUE, "You have used a gram of crack!");
UseDrugsTimer[playerid] = 1; PlayerDrugInfo[playerid][pCrack] -= 1;
SetTimerEx("UseDrugs",5*1000,0,"i",playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You don't have any crack left!");
}
return 1;
}
forward UseDrugs(playerid);
forward Crackdeath(playerid);
public UseDrugs(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(UseDrugsTimer[playerid])
{
UseDrugsTimer[playerid] = 0;
}
return 1;
}
public Crackdeath(playerid)
{
new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp-5);
}
CMD:healcrackoverdose(playerid, params[])
{
SetPlayerHealth(playerid, 100);
KillTimer(CrackDeathTimer[playerid]);
return 1;
}
Try this.
pawn Код:
|