28.09.2016, 17:59
Hey,
I am using a edited version of a filterscript released on samp forums of Weed growing, problem is it only includes making of 1 plant only, while i want to make 5 plants.
This is plant cmd:
This is the enum:
This pickweed
and finally this is the weedtimer
i want to make it like, player can plant 5 plants, not only 1.
Any help please?
I am using a edited version of a filterscript released on samp forums of Weed growing, problem is it only includes making of 1 plant only, while i want to make 5 plants.
This is plant cmd:
PHP код:
COMMAND:plantweed(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be onfoot to perform this command.");
if(WeedInfo[playerid][wAbleToPlant] < 6 && playerData[playerid][wSeeds] > 0)
{
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
new Float:X,Float:Y,Float:Z;
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0); // Applying it twice for ensurity
GetPlayerPos(playerid, X, Y, Z);
WeedInfo[weed][wPlantObject] = CreateDynamicObject(3409, X, Y, Z-1.0, 0, 0, 0, 0);
WeedInfo[weed][wX] = X;
WeedInfo[weed][wY] = Y;
WeedInfo[weed][wZ] = Z;
playerData[playerid][wSeeds] = playerData[playerid][wSeeds] - 1;
WeedInfo[weed][wLabel] = Create3DTextLabel("PLANT STATUS: Not ready for picking.",COLOR_SILVER,WeedInfo[weed][wX],WeedInfo[weed][wY],WeedInfo[weed][wZ],10.0,0);
WeedInfo[weed][wLabels]++;
WeedInfo[playerid][wAbleToPlant] = WeedInfo[playerid][wAbleToPlant] +1;
SetTimer("PlantWeedTimer",1000*5,0); // 60 seconds times 5 = 5 minutes.
SendClientMessage(playerid,COLOR_GREEN,"INFO: You have planted your seeds, it will now grow and be ready to /pickweed pick in 5 minutes.");
return 1;
}
}
else SendClientMessage(playerid,COLOR_GREY,"INFO: Unable to plant seeds, you already have a tleast 5 active plants to maintain. or have no seeds");
}
else
{
return SendClientMessage(playerid, COLOR_WHITE, "{FF0404}[ERROR] {FFFF00}You must be logged in to use commands.");
}
return 1;
}
PHP код:
enum wInfo
{
wAbleToPlant,
bool:wAbleToPick,
wPlantObject,
Float:wX,
Float:wY,
Float:wZ,
Text3D:wLabel,
wLabels
};
PHP код:
COMMAND:pickweed(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(IsPlayerInRangeOfPoint(playerid,5.0,WeedInfo[playerid][wX],WeedInfo[playerid][wY],WeedInfo[playerid][wZ]))
{
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
if(WeedInfo[playerid][wAbleToPick] == false) SendClientMessage(playerid,COLOR_GREY,"INFO: You do not have an active plant growing to pick.");
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
WeedInfo[weed][wAbleToPick] = false;
DestroyDynamicObject(WeedInfo[weed][wPlantObject]);
playerData[playerid][playerWeed] = playerData[playerid][playerWeed] + 5;
SendClientMessage(playerid, COLOR_GREEN,"INFO: You have picked your marijuana growth, and gained 5 grams +2 score in total.");
Delete3DTextLabel(WeedInfo[weed][wLabel]);
WeedInfo[playerid][wAbleToPlant] = WeedInfo[playerid][wAbleToPlant] -1;
WeedInfo[weed][wLabels]--;
return 1;
}
}
else SendClientMessage(playerid,COLOR_GREY,"INFO: You are not near any plants.");
}
else
{
return SendClientMessage(playerid, COLOR_WHITE, "{FF0404}[ERROR] {FFFF00}You must be logged in to use commands.");
}
return 1;
}
PHP код:
public PlantWeedTimer(playerid)
{
Update3DTextLabelText(WeedInfo[playerid][wLabel],COLOR_SILVER,"PLANT STATUS: Ready to be picked. Use /pickweed pick");
WeedInfo[playerid][wAbleToPick] = true;
}
i want to make it like, player can plant 5 plants, not only 1.
Any help please?