Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. CMD:plant(playerid, params[])
  2. {
  3. new string[128];
  4. if(sscanf(params, "s[8]", params))
  5. {
  6. SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /plant [type]");
  7. SendClientMessage(playerid, COLOR_GREY, "TYPES: Seeds ");
  8. return 1;
  9. }
  10. if(IsPlayerCuffed(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't do this right now.");
  11. if(!strcmp(params, "seeds", true))
  12. {
  13. if(PlayerInfo[playerid][pJob] != JOB_DDEALER && PlayerInfo[playerid][pVIPJob] != JOB_DDEALER) return SendClientMessage(playerid, COLOR_GREY, "You are not a drug dealer.");
  14. if(PlayerInfo[playerid][pSeeds] < 2) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough seeds. You need atleast 2 seeds!");
  15. if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You must be on foot!");
  16. if(CookTimer[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, " You are already cooking!");
  17. if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playerid, COLOR_GREY, "You must be outside to plant your seeds.");
  18. if(WeedPlanted[playerid] == 0)
  19. WeedPlanted[playerid] = 1;
  20. new Float:X, Float:Y, Float:Z;
  21. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0,1);
  22. GetPlayerPos(playerid, X, Y, Z);
  23. PlayerInfo[playerid][pWeedX] = X;
  24. PlayerInfo[playerid][pWeedY] = Y;
  25. PlayerInfo[playerid][pWeedZ] = Z;
  26. WeedObject[playerid] = CreateObject(3409, X, Y, Z-1.8, 0, 0, 0);
  27. PlayerInfo[playerid][pSeeds] -= 2;
  28. PlantTimer[playerid] = 1; //This makes the Variable a 1 So that means he has to wait 10 minutes.
  29. PlantPlayTimer[playerid]= SetTimerEx("CookPlant", 600000, false, "d", playerid); //Will set the timer so if the player use it again he will fail
  30. }
  31. return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement