Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ocmd:plantweed(playerid, params[])
- {
- if (buyspot[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "* You need to buy a grow spot!");
- if (!WEEDS[playerid])
- {
- SendClientMessage(playerid, COLOR_LIGHTRED," You don't have any weed-buds available!");
- return 1;
- }
- for(new weed = 0; weed < sizeof(WeedInfo); weed++)
- {
- if(WeedInfo[weed][WeedPlanted] == 0 && WeedInfo[weed][WeedTime] == 0)
- {
- if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GRAD2, "You must be on foot!");
- if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GRAD2, " You must be outside!");
- new Float:X,Float:Y,Float:Z;
- new playername[MAX_PLAYER_NAME];
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerName(playerid, playername, 24);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
- weedObject[weed] = CreateDynamicObject(3409, X, Y, Z-2, 0, 0, 0);
- WeedInfo[weed][WeedX] = X;
- WeedInfo[weed][WeedY] = Y;
- WeedInfo[weed][WeedZ] = Z;
- WeedInfo[weed][WeedTime] = 60;
- WeedInfo[weed][WeedPlanted] = 1;
- strmid(WeedInfo[weed][WeedPlanter], playername, 0, strlen(playername), 50);
- SendClientMessage(playerid,COLOR_LIGHTRED,"Weed seed planted. You have 3 seeds left.");
- SendClientMessage(playerid,COLOR_GREEN,"You have planted your seeds, it will take about an hour, for your crops to grow fully mature.");
- SendClientMessage(playerid,COLOR_GREEN,"Remember to type /pickweed Before someone else takes your weed, come back in about an-hour!");
- WEEDS[playerid] = WEEDS[playerid] - 3;
- buyspot[playerid] = 0;
- SetTimerEx("WeedAlarm", 3600000, false, "i", playerid);
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement