Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define FILTERSCRIPT
- #define COLOR_ERROR 0xAA3333AA
- #define COLOR_NOTIFICATION 0x33CCFFAA
- #define DIALOG_FISHJUSTCAUGHT 3223
- #define Fish_Price 3
- new
- FishingRod[MAX_PLAYERS],
- FishOnPlayer[MAX_PLAYERS],
- FishWeigh[MAX_PLAYERS];
- new Float:FishingPosX[MAX_PLAYERS],Float:FishingPosY[MAX_PLAYERS],Float:FishingPosZ[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- Create3DTextLabel("Pier Shop\n/Buyrod\n/sellfish", 0x008080FF, 378.6885,-2061.8040,7.8359, 40.0, 0, 1);
- Create3DTextLabel("Fishing Spot",0x008080FF, 403.9774,-2088.6292,7.8359, 40.0, 0, 1);
- Create3DTextLabel("Fishing Spot",0x008080FF, 383.0248,-2088.5334,7.8359, 40.0, 0, 1);
- Create3DTextLabel("Fishing Spot",0x008080FF, 356.4932,-2088.7969,7.8359, 40.0, 0, 1);
- Create3DTextLabel("Los Santos Fishing Pier",0x008080FF, 383.7704,-2048.6101,7.8359, 40.0, 0, 1);
- /* Fishing Pier */
- CreateObject(970, 379.95294, -2014.83093, 7.32475, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.95575, -2018.95471, 7.32475, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.54205, -2032.41858, 7.32475, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.54211, -2036.54163, 7.32470, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.54211, -2040.72363, 7.32470, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.54211, -2044.90564, 7.32470, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 379.54211, -2049.08765, 7.32470, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 392.42929, -2049.80054, 7.32470, 0.00000, 0.00000, 0.00000);
- CreateObject(10183, 395.28754, -2034.53809, 6.83220, 0.00000, 0.00000, -45.00000);
- CreateObject(970, 387.01730, -2049.80054, 7.32470, 0.00000, 0.00000, 0.00000);
- CreateObject(970, 381.60529, -2049.80054, 7.32470, 0.00000, 0.00000, 0.00000);
- CreateObject(970, 355.20148, -2050.41016, 7.32470, 0.00000, 0.00000, 90.00000);
- CreateObject(1215, 379.90939, -2014.85681, 7.37500, 356.85840, 0.00000, 3.14159);
- CreateObject(1215, 379.90939, -2019.03882, 7.37500, 356.85840, 0.00000, 3.14160);
- CreateObject(1215, 379.90933, -2021.27283, 7.37500, 356.85840, 0.00000, 3.14160);
- CreateObject(8406, 379.88095, -2028.95129, 12.19460, 0.00000, 0.00000, 89.00000);
- CreateObject(19425, 379.99271, -2023.55029, 6.83330, 0.00000, 0.00000, 90.00000);
- CreateObject(19425, 379.99271, -2027.97827, 6.83330, 0.00000, 0.00000, 90.00000);
- CreateObject(970, 398.60422, -2049.38306, 7.32470, 0.00000, 0.00000, 76.00000);
- CreateObject(1280, 379.63022, -2017.23962, 7.21094, 3.14159, 0.00000, 3.13624);
- CreateObject(1280, 379.20010, -2032.44482, 7.21094, 3.14159, 0.00000, 3.13624);
- CreateObject(1280, 379.19434, -2037.98877, 7.21094, 3.14159, 0.00000, 3.13624);
- CreateObject(1280, 379.25299, -2044.29431, 7.21094, 3.14159, 0.00000, 3.13624);
- CreateObject(1522, 378.20685, -2062.60962, 6.81255, 0.00000, 0.00000, 90.00000);
- CreateObject(1232, 364.87814, -2047.01599, 9.50000, 356.85840, 0.00000, 3.14159);
- CreateObject(1232, 392.43045, -2049.78467, 9.50000, 356.85840, 0.00000, 3.14159);
- CreateObject(1232, 387.01849, -2049.66162, 9.50000, 356.85840, 0.00000, 3.14160);
- CreateObject(1232, 381.60651, -2049.66162, 9.50000, 356.85840, 0.00000, 3.14160);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- #endif
- public OnPlayerConnect(playerid)
- {
- /* Fishing Pier stuff removed */
- RemoveBuildingForPlayer(playerid, 6463, 389.7734, -2028.4688, 19.8047, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2028.5000, 32.2266, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2021.6406, 29.9297, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2017.4531, 24.0313, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2017.4297, 16.8516, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2021.6328, 10.9844, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2028.5156, 8.7813, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2035.3984, 10.9453, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2039.6406, 16.8438, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2039.6563, 24.1094, 0.25);
- RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2035.3828, 29.9531, 0.25);
- RemoveBuildingForPlayer(playerid, 1232, 364.6094, -2036.1797, 9.5000, 0.25);
- RemoveBuildingForPlayer(playerid, 1280, 378.4609, -2012.9297, 7.2109, 0.25);
- RemoveBuildingForPlayer(playerid, 1215, 386.5703, -2061.9531, 7.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1215, 379.5938, -2042.4922, 7.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1215, 379.5938, -2016.7500, 7.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1215, 386.5703, -2049.3516, 7.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1340, 388.8594, -2071.6641, 7.9453, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2039.6406, 16.8438, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2039.6563, 24.1094, 0.25);
- RemoveBuildingForPlayer(playerid, 6298, 389.7734, -2028.4688, 19.8047, 0.25);
- RemoveBuildingForPlayer(playerid, 6461, 389.7734, -2028.5000, 20.1094, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2028.5000, 32.2266, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2021.6406, 29.9297, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2017.4531, 24.0313, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2017.4297, 16.8516, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2021.6328, 10.9844, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2028.5156, 8.7813, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2035.3984, 10.9453, 0.25);
- RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2035.3828, 29.9531, 0.25);
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Fishing job created by TwinkiDaBoss (Type /fishinghelp to find all commands for the job).");
- return 1;
- }
- //Commands
- CMD:fishinghelp(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Type /fish to start fishing. You must be near some of the fishing spots (LS Fishing Pier)");
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Type /Sellfish to sell your fishes and get money from it");
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Type /fishes to see how many Kilograms of fish you have on you");
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Type /buyrod to buy a fishing rod");
- return true;
- }
- CMD:fish(playerid,params[])
- {
- new Float:x,Float:y,Float:z;
- if(IsPlayerInRangeOfPoint(playerid,10.0,354.3251,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid,10.0,362.3351,-2088.7979,7.8359) ||
- IsPlayerInRangeOfPoint(playerid,10.0,367.0258,-2088.7979,7.8359) || IsPlayerInRangeOfPoint(playerid,10.0,369.7540,-2088.7981,7.8359) ||
- IsPlayerInRangeOfPoint(playerid,10.0,374.0645,-2088.7969,7.8359) || IsPlayerInRangeOfPoint(playerid,10.0,383.3422,-2088.7974,7.8359) ||
- IsPlayerInRangeOfPoint(playerid,10.0,390.2083,-2088.7983,7.8359) || IsPlayerInRangeOfPoint(playerid,10.0,396.6046,-2088.7979,7.8359) ||
- IsPlayerInRangeOfPoint(playerid,10.0,403.5682,-2088.7976,7.8359) || IsPlayerInRangeOfPoint(playerid,10.0,409.2429,-2088.6521,7.8359))
- {
- if(FishingRod[playerid] == 0)
- return SendClientMessage(playerid,COLOR_ERROR,"You must have a fishing rod in order to fish!");
- if(IsPlayerInRangeOfPoint(playerid,5.0,FishingPosX[playerid],FishingPosY[playerid],FishingPosZ[playerid]))
- return SendClientMessage(playerid,COLOR_ERROR,"You cannot fish at the same place like before! Move little bit!");
- if(FishOnPlayer[playerid] >= 10)
- return SendClientMessage(playerid,COLOR_ERROR,"You have already caught more than 10 fishes! Go sell them first.");
- GetPlayerPos(playerid,x,y,z);
- FishingPosX[playerid] = x;
- FishingPosY[playerid] = y;
- FishingPosZ[playerid] = z;
- FishWeigh[playerid] = 0;
- ApplyAnimation(playerid,"SWORD","sword_block",50.0 ,0,1,0,1,1);
- SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
- SetTimerEx("PlayerFishing",5000,false,"i",playerid);
- SendClientMessage(playerid,COLOR_NOTIFICATION,"Fishing... Do not move");
- }
- else SendClientMessage(playerid,COLOR_ERROR,"You are not near any fishing spot");
- return true;
- }
- CMD:fishes(playerid,params[])
- {
- new string[128];
- format(string,sizeof(string),"You currently have %i kilograms of fish on you",FishWeigh[playerid]);
- SendClientMessage(playerid,COLOR_NOTIFICATION,string);
- return true;
- }
- CMD:buyrod(playerid, params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,5.0,379.1845,-2062.6423,7.8359))
- return SendClientMessage(playerid,COLOR_ERROR,"You are not near the Fishing Pier Shop");
- if(GetPlayerMoney(playerid) < 50) //Replace with your variable
- return SendClientMessage(playerid,COLOR_ERROR,"You dont have enough money. Required 50$");
- if(FishingRod[playerid] >= 1)
- return SendClientMessage(playerid,COLOR_ERROR,"You already have a fishing rod!");
- GivePlayerMoney(playerid,-50);
- FishingRod[playerid] = 1;
- SendClientMessage(playerid,COLOR_NOTIFICATION,"You have purchased a fishing rod. 50$ was deducated from your wallet");
- return true;
- }
- CMD:sellfish(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,5.0,379.1845,-2062.6423,7.8359))
- return SendClientMessage(playerid,COLOR_ERROR,"You are not near the Fishing Pier Shop");
- new string[128], pay;
- pay = FishWeigh[playerid]*Fish_Price;
- format(string,sizeof(string),"You have earned %i$ by selling your %i kilograms of fish",pay,FishWeigh[playerid]);
- SendClientMessage(playerid,COLOR_NOTIFICATION,string);
- FishWeigh[playerid] = 0;
- FishOnPlayer[playerid] = 0;
- GivePlayerMoney(playerid,pay);
- return true;
- }
- forward PlayerFishing(playerid);
- public PlayerFishing(playerid)
- {
- new fish = randomEx(1,5), str[128], moneybag = randomEx(10,200),string[128],fweight = randomEx(1,50);
- RemovePlayerAttachedObject(playerid,0);
- if(!IsPlayerInRangeOfPoint(playerid,3.0, FishingPosX[playerid],FishingPosY[playerid],FishingPosZ[playerid]))
- return SendClientMessage(playerid, COLOR_ERROR,"You have moved from your fishing spot. You failed catching the fish");
- switch(fish)
- {
- case 1: { str = "{37DB45}Your fishing rod {FF0000}snaps {37DB45}as you try to catch the fish"; FishingRod[playerid] = 0; }
- case 2: { format(string,sizeof(string),"{37DB45}You have caught money bag holding {FF0000}%i$",moneybag); str = string; GivePlayerMoney(playerid, moneybag); }
- case 3: { format(string,sizeof(string),"{37DB45}You have caught {FF0000}%s {37DB45}weighting {FF0000}%i {37DB45}kilograms",GetFishSpecie(),fweight); str = string; FishWeigh[playerid] += fweight; FishOnPlayer[playerid] += 1;}
- case 4: str = "{37DB45}You reelin your rod to find out {FF0000}you havent caught anything";
- case 5: str = "{37DB45}You reelin your rod to find out you have caught a {FF0000}boot";
- }
- return ShowPlayerDialog(playerid, DIALOG_FISHJUSTCAUGHT, DIALOG_STYLE_MSGBOX, "Notice", str, "Close", "");
- }
- stock GetFishSpecie()
- {
- new fishspecie = randomEx(0,10), strz[64];
- switch(fishspecie)
- {
- case 0: strz = "Shark";
- case 1: strz = "Barracuda";
- case 2: strz = "Silverfish";
- case 3: strz = "Bass";
- case 4: strz = "Batfish";
- case 5: strz = "Catfish";
- case 6: strz = "Black Tetra";
- case 7: strz = "Black Dragonfish";
- case 8: strz = "Carp";
- case 9: strz = "Boga";
- case 10: strz = "Eel";
- }
- return strz;
- }
- stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement