#1

Hi I wanna make a weed system which when u spawn a drug dealer u have 10 seeds u go to a farm and do /plant then /water

Here is my question : once u have watered the weed a weed plant would slowly rise from the ground so is there an object of the weed plant like in the mission where u have to burn them with truth
Reply
#2

There are filterscripts for this, but if you find the object ID I will do it for you.

Thanks!
Reply
#3

Ok ill search all over for the I'd (if there is)
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)