Advertisement
Guest User

Untitled

a guest
Mar 13th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.23 KB | None | 0 0
  1. ocmd:plantweed(playerid, params[])
  2. {
  3.     if (buyspot[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "* You need to buy a grow spot!");
  4.         if (!WEEDS[playerid])
  5.         {
  6.                 SendClientMessage(playerid, COLOR_LIGHTRED," You don't have any weed-buds available!");
  7.                 return 1;
  8.         }
  9.         for(new weed = 0; weed < sizeof(WeedInfo); weed++)
  10.     {
  11.                 if(WeedInfo[weed][WeedPlanted] == 0 && WeedInfo[weed][WeedTime] == 0)
  12.                 {
  13.                         if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GRAD2, "You must be on foot!");
  14.                     if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GRAD2, " You must be outside!");
  15.                     new Float:X,Float:Y,Float:Z;
  16.                     new playername[MAX_PLAYER_NAME];
  17.                     GetPlayerPos(playerid, X, Y, Z);
  18.                         GetPlayerName(playerid, playername, 24);
  19.                         ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
  20.                         weedObject[weed] = CreateDynamicObject(3409, X, Y, Z-2, 0, 0, 0);
  21.                         WeedInfo[weed][WeedX] = X;
  22.                         WeedInfo[weed][WeedY] = Y;
  23.                         WeedInfo[weed][WeedZ] = Z;
  24.                         WeedInfo[weed][WeedTime] = 60;
  25.                         WeedInfo[weed][WeedPlanted] = 1;
  26.                         strmid(WeedInfo[weed][WeedPlanter], playername, 0, strlen(playername), 50);
  27.                         SendClientMessage(playerid,COLOR_LIGHTRED,"Weed seed planted. You have 3 seeds left.");
  28.                         SendClientMessage(playerid,COLOR_GREEN,"You have planted your seeds, it will take about an hour, for your crops to grow fully mature.");
  29.                         SendClientMessage(playerid,COLOR_GREEN,"Remember to type /pickweed Before someone else takes your weed, come back in about an-hour!");
  30.                         WEEDS[playerid] = WEEDS[playerid] - 3;
  31.                         buyspot[playerid] = 0;
  32.                         SetTimerEx("WeedAlarm", 3600000, false, "i", playerid);
  33.                         return 1;
  34.                 }
  35.         }
  36.         return 1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement