14.02.2013, 23:10
When the player /harvest the plants, it won't delete the object that the player made earlier. I want to make it to where it only deletes the object that player made.
(not deleting anyone else who has /plant)
(not deleting anyone else who has /plant)
pawn Код:
new bool:cHarvest[MAX_PLAYERS] = false;
timer cWait[6000](playerid)
{
cHarvest[playerid] = true;
SendClientMessage(playerid,COLOR_RED,"Plant ready!");
}
CMD:plant(playerid, params[])
{
if(pInfo[playerid][Seeds] > 2)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateObject(19473,x,y,z-2,0,0,0);
pInfo[playerid][Seeds]-=3;
SendClientMessage(playerid,COLOR_GRAY,"Your plant will be ready in six seconds.");
defer cWait(playerid);
}
else SendClientMessage(playerid,COLOR_RED,"You don't have enough seeds!");
return 1;
}
CMD:harvest(playerid, params[])
{
// new Float:x,Float:y,Float:z;
// GetObjectPos(19473,x,y,z);
// if(IsPlayerInRangeOfPoint(playerid,7,x,y,z))
//{
if(cHarvest[playerid])
{
DestroyObject(19473);
pInfo[playerid][Weed]+=9;
SendClientMessage(playerid,COLOR_GRAY,"You've harvested nine grams of weed.");
}
else SendClientMessage(playerid,COLOR_RED,"This isn't ready yet!");
//}
return 1;
}