Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- // Some configurations for the script to work
- new IsDrugger[MAX_PLAYERS];
- new HasMaterials[MAX_PLAYERS];
- new HasDrugs[MAX_PLAYERS];
- new IsDrunk[MAX_PLAYERS];
- new lightblue = 0xADD8E6FF;
- new red = 0xFF0000AA;
- public OnFilterScriptInit()
- {
- // Takejob configurations
- CreatePickup(1239, 1, 2065.2837,-1558.5857,13.4369, -1);
- Create3DTextLabel("Drugger job\n/takedruggerjob | /quitdruggerjob", 0xFF0000AA, 2065.2837,-1558.5857,13.4369, 5.0, 0, 0);
- // pickupmaterials configurations
- CreatePickup(1254, 1, 2067.4619, -1561.9774, 13.4270, -1);
- Create3DTextLabel("Drugger job\n/pickupmaterials", 0xFF0000AA, 2067.4619,-1561.9774,13.4270, 5.0, 0, 0);
- // createdrugs configurations
- CreatePickup(1279, 1, 2355.3733, -648.4775, 128.0547, -1);
- Create3DTextLabel("Drugger job\n/createdrugs", 0xFF0000AA, 2355.3733, -648.4775, 128.0547, 5.0, 0, 0);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- COMMAND:takedruggerjob(playerid, params[])
- {
- if(IsDrugger[playerid] == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 2065.2837, -1558.5857, 13.4369))
- {
- IsDrugger[playerid] = 1;
- SendClientMessage(playerid, lightblue, "Congratulations. You're now an Drugger. For more help about your job please use '/druggerhelp'.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not at the place to take the Drugger job.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're already an Drugger.");
- return 1;
- }
- COMMAND:quitdruggerjob(playerid, params[])
- {
- if(IsDrugger[playerid] == 1)
- {
- SendClientMessage(playerid, lightblue, "You left your drugger job.");
- IsDrugger[playerid] = 0;
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not an drugger.");
- return 1;
- }
- COMMAND:druggerhelp(playerid, params[])
- {
- new msg[2000];
- format(msg, 2000, "%s{FFFFFF}Hello Drugger,\n\n\n", msg);
- format(msg, 2000, "%s{FFFFFF}These are the commands of your job:\n\n", msg);
- format(msg, 2000, "%s{FF0000}1. {FFFFFF}/takedruggerjob -> Takes the Drugger job\n", msg);
- format(msg, 2000, "%s{FF0000}2. {FFFFFF}/pickupmaterials -> Picks up the required materials for creating drugs\n", msg);
- format(msg, 2000, "%s{FF0000}3. {FFFFFF}/quitdruggerjob -> Quits the Drugger job\n", msg);
- format(msg, 2000, "%s{FF0000}4. {FFFFFF}/createdrugs -> Creates drugs\n", msg);
- format(msg, 2000, "%s{FF0000}5. {FFFFFF}/givedrugs -> You can trade drugs for cash with other players near you\n", msg);
- format(msg, 2000, "%s{FF0000}6. {FFFFFF}/usedrugs -> You can use the drugs you got\n", msg);
- format(msg, 2000, "%s{FF0000}7. {FFFFFF}/mydrugs -> Checks if you got drugs or not\n\n", msg);
- format(msg, 2000, "%s{FFFFFF}Thank you for reading the help menu", msg);
- if(IsDrugger[playerid] == 1)
- {
- ShowPlayerDialog(playerid, 5678, DIALOG_STYLE_MSGBOX, "{FFFFFF}Drugger Help", msg, "Okay", "");
- return 1;
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not an Drugger.");
- return 1;
- }
- COMMAND:pickupmaterials(playerid, params[])
- {
- if(IsDrugger[playerid] == 1)
- {
- if(HasMaterials[playerid] == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 2067.4619,-1561.9774,13.4270))
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- SetTimer("pickingmaterials", 5000, false);
- SendClientMessage(playerid, lightblue, "You started loading part of drugs materials.");
- TogglePlayerControllable(playerid, 0);
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not at the materials pickup position.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You can only load 1 pack of materials at one time.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not a Drugger.");
- }
- forward pickingmaterials(playerid);
- public pickingmaterials(playerid)
- {
- HasMaterials[playerid] = 1;
- SendClientMessage(playerid, lightblue, "You have loaded the materials successfully. Take care of police.");
- TogglePlayerControllable(playerid, 1);
- SetPlayerCheckpoint(playerid, 2355.3733, -648.4775, 128.0547, 1.0);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- return 1;
- }
- COMMAND:createdrugs(playerid, params[])
- {
- if(IsDrugger[playerid] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 2355.3733, -648.4775, 128.0547))
- {
- HasDrugs[playerid] = 1;
- SendClientMessage(playerid, lightblue, "Congratulations. You've created drugs.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not at the drugs creation place.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not an Drugger.");
- }
- COMMAND:usedrugs(playerid, params[])
- {
- if(HasDrugs[playerid] == 1)
- {
- HasDrugs[playerid] = 0;
- SetTimer("drunkstart", 5000, false);
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, lightblue, "You're now using the drugs. It will take a while till you finish it all.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You don't have drugs. Ask someone who has it to give it to you.");
- }
- forward drunkstart(playerid);
- public drunkstart(playerid)
- {
- IsDrunk[playerid] = 1;
- TogglePlayerControllable(playerid, 1);
- SetPlayerDrunkLevel(playerid, 50000);
- SendClientMessage(playerid, lightblue, "You're now under effects of drugs. Be sure the cops wont bust you.");
- SetTimer("drunkmiddle", 15000, false);
- return 1;
- }
- forward drunkmiddle(playerid);
- public drunkmiddle(playerid)
- {
- SendClientMessage(playerid, lightblue, "You've slowly recovering your self from the drugs.");
- SetPlayerDrunkLevel(playerid, 25000);
- SetTimer("drunkend", 7500, false);
- return 1;
- }
- forward drunkend(playerid);
- public drunkend(playerid)
- {
- SetPlayerDrunkLevel(playerid, 0);
- SendClientMessage(playerid, lightblue, "You fully recovered your self from the drugs.");
- IsDrunk[playerid] = 0;
- return 1;
- }
- COMMAND:mydrugs(playerid, params[])
- {
- if(HasDrugs[playerid] == 1)
- {
- SendClientMessage(playerid, lightblue, "You have drugs in your bag.");
- }
- else if(HasDrugs[playerid] == 0)
- {
- SendClientMessage(playerid, lightblue, "You don't have any drugs in your bag.");
- }
- return 1;
- }
- COMMAND:givedrugs(playerid, params[])
- {
- new OtherPlayer, OtherPlayerName[24], msg[2000], YourName[24];
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(HasDrugs[playerid] == 1)
- {
- if(IsPlayerInRangeOfPoint(OtherPlayer, 2.0, x, y, z))
- {
- GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
- GetPlayerName(playerid, YourName, sizeof(YourName));
- HasDrugs[OtherPlayer] = 1;
- HasDrugs[playerid] = 0;
- format(msg, 2000, "You've sent drugs to %s.", OtherPlayerName);
- SendClientMessage(playerid, lightblue, msg);
- format(msg, 2000, "You've recieved drugs from %s.", YourName);
- SendClientMessage(OtherPlayer, lightblue, msg);
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You're not near that person.");
- }
- else
- SendClientMessage(playerid, red, "[ERROR] You can't send drugs you don't own.");
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement