Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <ZCMD>
- #include <sscanf2>
- #include <streamer>
- #define COLOR_GREEN 0x008000AA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_YELLOW 0xDABB3E00
- enum wInfo
- {
- wPlanted,
- wTime,
- wObject,
- Float:wX,
- Float:wY,
- Float:wZ,
- wWeed
- };
- new WeedInfo[50][wInfo];
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- }
- return Name;
- }
- stock DrugLimitLeft(playerid,type)
- {
- new amountcheck,amount;
- switch(type)
- {
- case 1: // Weed
- {
- amountcheck = WeedInfo[playerid][wWeed];
- }
- }
- amount = 50 - amountcheck;
- return amount;
- }
- stock DrugLimit(playerid,amount,type)
- {
- new amountcheck;
- switch(type)
- {
- case 1: // Weed
- {
- amountcheck = amount + WeedInfo[playerid][wWeed];
- }
- }
- if(amountcheck < 51)
- {
- return 1;
- }
- return 0;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- }
- COMMAND:drugs(playerid, params[])
- {
- new usage[128], type[128], targetid, amount, string[128];
- if(sscanf(params, "s[128]S(none)[128]U(999)I(0)", usage, type, targetid, amount)) SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [use/give/plant/pick/combine]");
- else
- {
- if(strcmp(usage, "use", true) == 0) if(strcmp(type, "none", true) == 0) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [use] [cocaine/crack/weed]");
- if(strcmp(usage, "give", true) == 0) if(targetid == 999 || amount == 0) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [give] [cocaine/crack/weed] [playerid] [amount]");
- if(strcmp(usage, "plant", true) == 0)
- {
- if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be on foot to use this.");
- if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be outside to use this.");
- for(new weed = 0; weed < sizeof(WeedInfo); weed++)
- {
- if(WeedInfo[weed][wPlanted] == 0 && WeedInfo[weed][wTime] == 0)
- {
- new Float:X,Float:Y,Float:Z;
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
- GetPlayerPos(playerid, X, Y, Z);
- WeedInfo[weed][wObject] = CreateDynamicObject(3409, X, Y, Z-2.0, 0, 0, 0, 0);
- WeedInfo[weed][wX] = X;
- WeedInfo[weed][wY] = Y;
- WeedInfo[weed][wZ] = Z;
- WeedInfo[weed][wTime] = 60;
- WeedInfo[weed][wPlanted] = 1;
- SendClientMessage(playerid,COLOR_GREEN,"INFO: You have planted your weed plant it will be ready to /drugs pick in 'X amount' of time.");
- return 1;
- }
- }
- }
- else if(strcmp(usage, "pick", true) == 0)
- {
- if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be on foot to use this.");
- for(new weed = 0; weed < sizeof(WeedInfo); weed++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0,WeedInfo[weed][wX],WeedInfo[weed][wY],WeedInfo[weed][wZ]))
- {
- if(WeedInfo[weed][wPlanted] == 1 && WeedInfo[weed][wX] != 0.0 && WeedInfo[weed][wY] != 0.0 && WeedInfo[weed][wZ] != 0.0)
- {
- if (WeedInfo[weed][wTime] >= 0) return SendClientMessage(playerid, COLOR_YELLOW, "INFO: This plant is not ready to be picked yet.");
- if (DrugLimit(playerid,30,1))
- {
- format(string, sizeof(string), "INFO: You cannot hold this amount of weed grams in your hand, can only hold %d more grams.", DrugLimitLeft(playerid,1));
- SendClientMessage(playerid, COLOR_GREY, string);
- return 1;
- }
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
- DestroyDynamicObject(WeedInfo[weed][wObject]);
- WeedInfo[weed][wX] = 0.0;
- WeedInfo[weed][wY] = 0.0;
- WeedInfo[weed][wZ] = 0.0;
- WeedInfo[weed][wPlanted] = 0;
- SendClientMessage(playerid,COLOR_GREEN,"INFO: You have picked up this plant.");
- return 1;
- }
- }
- }
- }
- }
- return 1;
- }
- COMMAND:drughelp(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_GREY, "USAGE: /drugs");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment