vendredi 15 juillet 2016

drug system help

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting.



drug system help

Little Clucker

 

Join Date: Jun 2016

Posts: 4

Reputation: 0

Defaultdrug system help

http://ift.tt/29CTd8D

I download that filterscript and I want to make /plant harvest is only allowed for your plant only,how do i do that?

/plant cmd

PHP Code:

COMMAND:plant(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't use this command in a vehicle.");
    if(
isnull(params)) return SendClientMessage(playerid0xE88732FF"SYNTAX: {FFFFFF}/plant [place/harvest]");

    if(!

strcmp(params"place"true)) {
        
/* -- planting -- */
        
if(Player[playerid][InDrugZone] == false) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You aren't in drug zone.");
        if(
PlayerDrugData[playerid][Seeds] < 1) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You don't have a drug seed.");
        if(
Player_PlantCount(playerid) >= PLAYER_LIMIT) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't plant any more drug plants.");
        if(
GetClosestPlant(playerid) != -1) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't place a drug plant here because there is one nearby.");
        new 
id Iter_Free(Plants);
        if(
id == -1) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}Server drug plant limit reached.");
        
GetPlayerName(playeridPlantData[id][plantedBy], MAX_PLAYER_NAME);
        
GetPlayerPos(playeridPlantData[id][plantX], PlantData[id][plantY], PlantData[id][plantZ]);PlantData[id][plantGrowth] = 0;
        
PlantData[id][plantObj] = CreateDynamicObject(3409PlantData[id][plantX], PlantData[id][plantY], PlantData[id][plantZ] - 0.750.00.00.0);
        
SetDynamicObjectMaterial(PlantData[id][plantObj], 219478"signsurf""sign"0xFFFFFFFF);

        new 

label_string[128];
        
format(label_stringsizeof(label_string), "Drug Plant (%d)\n\n{FFFFFF}Placed by %s\nGrowth: {E74C3C}0%%\n\n{FFFFFF}/plant harvest"idPlantData[id][plantedBy]);
        
PlantData[id][plantLabel] = CreateDynamic3DTextLabel(label_string0xF1C40FFFPlantData[id][plantX], PlantData[id][plantY], PlantData[id][plantZ], 5.0);PlantData[id][plantTimer] = SetTimerEx("PlantGrowth"GROWTH_INTERVAL 1000true"i"id);
        
Iter_Add(Plantsid);PlayerDrugData[playerid][Seeds]--;
        
PlayerDrugData[playerid][TotalPlanted]++;
        
/* -- planting -- */
    
}else if(!strcmp(params"harvest")) {
        
/* -- harvesting -- */
        
if(PlayerDrugData[playerid][Drugs] >= CARRY_LIMIT) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't carry any more drugs.");
        new 
id GetClosestPlant(playerid);
        if(
id == -1) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You're not near a drug plant.");
        if(!
PlantData[id][gotLeaves]) return SendClientMessage(playerid0xE74C3CFF"ERROR: {FFFFFF}You can't harvest this plant because it's not ready.");
        new 
harvested PlantData[id][plantGrowth], string[96];
        if(
PlayerDrugData[playerid][Drugs] + harvested CARRY_LIMITharvested CARRY_LIMIT PlayerDrugData[playerid][Drugs];
        
format(stringsizeof(string), "DRUG PLANT: {FFFFFF}You harvested a drug plant and got %d grams of drugs."harvested);
        
SendClientMessage(playerid0x3498DBFFstring);PlayerDrugData[playerid][Drugs] += harvested;
        
PlayerDrugData[playerid][TotalHarvestedPlants]++;
        
PlayerDrugData[playerid][TotalHarvestedGrams] += harvested;

        new 

owner_id Plant_GetOwnerID(id);
        if(
strcmp(PlantData[id][plantedBy], Player_GetName(playerid), true) && IsPlayerConnected(owner_id)) SendClientMessage(owner_id0x3498DBFF"DRUG PLANT: {FFFFFF}Somebody harvested one of your drug plants!");Plant_Destroy(id);
        
/* -- harvesting -- */
    
}else{
        
SendClientMessage(playerid0xE88732FF"SYNTAX: {FFFFFF}/plant [place/harvest]");
    } 

Aucun commentaire:

Enregistrer un commentaire