Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:plant(playerid, params[])
- {
- new string[128];
- if(sscanf(params, "s[8]", params))
- {
- SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /plant [type]");
- SendClientMessage(playerid, COLOR_GREY, "TYPES: Seeds ");
- return 1;
- }
- if(IsPlayerCuffed(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't do this right now.");
- if(!strcmp(params, "seeds", true))
- {
- if(PlayerInfo[playerid][pJob] != JOB_DDEALER && PlayerInfo[playerid][pVIPJob] != JOB_DDEALER) return SendClientMessage(playerid, COLOR_GREY, "You are not a drug dealer.");
- if(PlayerInfo[playerid][pSeeds] < 2) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough seeds. You need atleast 2 seeds!");
- if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You must be on foot!");
- if(CookTimer[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, " You are already cooking!");
- if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playerid, COLOR_GREY, "You must be outside to plant your seeds.");
- if(WeedPlanted[playerid] == 0)
- WeedPlanted[playerid] = 1;
- new Float:X, Float:Y, Float:Z;
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0,1);
- GetPlayerPos(playerid, X, Y, Z);
- PlayerInfo[playerid][pWeedX] = X;
- PlayerInfo[playerid][pWeedY] = Y;
- PlayerInfo[playerid][pWeedZ] = Z;
- WeedObject[playerid] = CreateObject(3409, X, Y, Z-1.8, 0, 0, 0);
- PlayerInfo[playerid][pSeeds] -= 2;
- PlantTimer[playerid] = 1; //This makes the Variable a 1 So that means he has to wait 10 minutes.
- PlantPlayTimer[playerid]= SetTimerEx("CookPlant", 600000, false, "d", playerid); //Will set the timer so if the player use it again he will fail
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement