16.08.2013, 23:06
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.");
PIC: