That's fine, I will create the script whilst I wait and then I will do it for you, I will edit this post when it's done.
Edit:
This is the script:
pawn Код:
new Float:WeedX[MAX_PLAYERS], Float:WeedY[MAX_PLAYERS], Float:WeedZ[MAX_PLAYERS], Float:WeedA[MAX_PLAYERS], WeedSeeds[MAX_PLAYERS], WeedPlant;
Add them to the top of the script.
pawn Код:
public OnPlayerConnect(playerid)
{
WeedX[playerid] = -1.0;
WeedY[playerid] = -1.0;
WeedZ[playerid] = -1.0;
WeedA[playerid] = -1.0;
WeedSeeds[playerid] = 10;
return 1;
}
Add this under your "OnPlayerConnect".
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
WeedX[playerid] = -1.0;
WeedY[playerid] = -1.0;
WeedZ[playerid] = -1.0;
WeedA[playerid] = -1.0;
return 1;
}
Add them to your OnPlayerDisconnect.
pawn Код:
command(plant, playerid, params[])
{
if(WeedSeeds[playerid] >= 1)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
WeedX[playerid] = x;
WeedY[playerid] = y;
WeedZ[playerid] = z;
WeedA[playerid] = a;
WeedSeeds[playerid] -= 1;
SendClientMessage(playerid, 0xFFFFFFF, "You have planted a seed. Use /water to grow it!");
WeedPlant = CreateObject(213, WeedX[playerid]-4.0, WeedY[playerid], WeedZ[playerid], WeedA[playerid], WeedA[playerid], WeedA[playerid], 15.0);
return 1;
}
else return SendClientMessage(playerid, 0xFFFFFFF, "You don't have any weed left.");
}
command(water, playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, WeedX[playerid], WeedY[playerid], WeedZ[playerid]))
{
MoveObject(WeedPlant, WeedX[playerid]+1.0, WeedY[playerid], WeedZ[playerid], 1.0, 0.0, 0.0, 0.0);
}
else return SendClientMessage(playerid, 0xFFFFFFF, "You must be near to where you planted the weed.");
return 1;
}
Add them anywhere outside of callbacks.