PHP Code:
stock GatherDrug(playerid,slot)
{
if(DrugInfo[slot][dTime] < 604800)
{
switch(DrugInfo[slot][dType])
{
case DRUG_WEED:
{
new amount = (random(9) + 1);
if(CanHaveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_WEED,amount))
{
new rec = GiveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_WEED,amount);
if(rec)
{
DrugInfo[slot][dTime] = 0;
DrugInfo[slot][dType] = 0;
F_DestroyObject(DrugInfo[slot][dObject]);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED,"You cannot carry anything else!");
}
}
case DRUG_HEROIN:
{
new amount = (random(4) + 1);
if(CanHaveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_HEROIN,amount))
{
new rec = GiveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_HEROIN,amount);
if(rec)
{
DrugInfo[slot][dTime] = 0;
DrugInfo[slot][dType] = 0;
F_DestroyObject(DrugInfo[slot][dObject]);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED,"You cannot carry anything else!");
}
}
case DRUG_COKE:
{
new amount = (random(4) + 1);
if(CanHaveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_COKE,amount))
{
new rec = GiveItem(INVENTORY_TYPE_PLAYER,playerid,INVENTORY_COKE,amount);
if(rec)
{
DrugInfo[slot][dTime] = 0;
DrugInfo[slot][dType] = 0;
F_DestroyObject(DrugInfo[slot][dObject]);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED,"You cannot carry anything else!");
}
}
}
}
else
{
DrugInfo[slot][dTime] = 0;
DrugInfo[slot][dType] = 0;
F_DestroyObject(DrugInfo[slot][dObject]);
SendClientMessage(playerid,COLOR_YELLOW2,"Questa pianta и vecchia e inutilizzabile.");
SendEmote(playerid,"inizia a rimuovere la pianta da terra.");
}
}