Moveing Object
#1

pawn Код:
dcmd_plant( playerid, params[])
{
    #pragma unused 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(3409, WeedX[playerid], WeedY[playerid], WeedZ[playerid]-4.0, WeedA[playerid], WeedA[playerid], WeedA[playerid], 15.0);
        return 1;
    }
    else return SendClientMessage(playerid, 0xFFFFFFF, "You don't have any weed left.");
}

dcmd_water( playerid, params[])
{
    #pragma unused params
    if(IsPlayerInRangeOfPoint(playerid, 5.0, WeedX[playerid], WeedY[playerid], WeedZ[playerid]))
    {
        MoveObject(WeedPlant, WeedX[playerid], WeedY[playerid], WeedZ[playerid]+0.1, 1.0, 0.0, 0.0, 0.0);
    }
    else return SendClientMessage(playerid, 0xFFFFFFF, "You must be near to where you planted the weed.");
But after i use /water , the object is created higher than i want , coz i want it on the ground after /water

PIC:
Reply
#2


Change this:
pawn Код:
MoveObject(WeedPlant, WeedX[playerid], WeedY[playerid], WeedZ[playerid]+0.1, 1.0, 0.0, 0.0, 0.0);
To this:
pawn Код:
MoveObject(WeedPlant, WeedX[playerid], WeedY[playerid], WeedZ[playerid]-0.2, 1.0, 0.0, 0.0, 0.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)