Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_vcmp>
- #define COLOR_GREY 0xAFAFAFAA
- #define NOTACCES 0xFF0000AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define INACTIVE_PLAYER_ID 255
- #define BLUE 0x377DFFFF
- #define COLOR 0x377DFFFF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOUR_GREEN 0x33AA33AA
- #define COLOUR_RED 0xAA3333AA
- #define COLOUR_YELLOW 0xFFFF00AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_PINK 0xFFC0CBAA
- #define COLOR_ORANGE 0xFF9900AA
- #define FILTERSCRIPT
- //new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
- new boughtr[MAX_PLAYERS];
- new boughtw[MAX_PLAYERS];
- new fishing[MAX_PLAYERS];
- new hfish[MAX_PLAYERS];
- enum randomfishing {
- tfish[256],
- fish,
- mon,
- hp,
- }
- new randomfish[][randomfishing] = {
- {"WoW... this is the golden fish !!!",1,15000,100},
- {"You fished a mandarin fish ![Good] !!!",1,3000,63},
- {"Cool, a Prussian Carp !",1,6300,12},
- {"Hahahaha... you fished a boot.",0,3000,0},
- {"You fished a cat fish!",1,5000,41},
- {"A Sea Snake, Cool (^_^)",1,3000,1},
- {"LoL... You fished a hat [hahaha]",0,6000,0},
- {"You caught a carp of 1 kg ! [Good for you]",1,4000,30},
- {"Hahahaha... you fished a boot.",0,3000,0},
- {"Funny...You fished a small fish", 1,1000,10},
- {"That's your bad day... you failed to fishing",0,1000,40},
- {"This is your lucky day. You fished a big carp !!!",1,8000,50},
- {"This is a shoes ? Hahahah!",0,2000,12},
- {"Your fish escape!",0,1000,63}
- };
- forward waitfish();
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public OnFilterScriptInit()
- {
- printf("------------------------------------------");
- printf("Fishing System By Moby is allowed !");
- printf("------------------------------------------");
- return 1;
- }
- public OnFilterScriptExit()
- {
- printf("WARNING: The Fishing System By Moby can't be allowd !");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- fishing[playerid] = 0;
- boughtw[playerid] = 0;
- boughtr[playerid] = 0;
- hfish[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid,killerid,reason)
- {
- fishing[playerid] = 0;
- hfish[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- if(strcmp(cmdtext, "fhelp", true) == 0) {
- SendClientMessage(playerid,COLOR_YELLOW,"-----------Fishing Help-----------");
- SendClientMessage(playerid,COLOR_YELLOW,"For a good job, type '/aim' before fishing !");
- SendClientMessage(playerid,COLOR_YELLOW,"For eat,sell,live fish type '[/c] eatf, sellf,livef' !");
- SendClientMessage(playerid,COLOR_YELLOW,"For Fishing type '/c fishing' !");
- SendClientMessage(playerid,COLOR_YELLOW,"For buy rod and worms type '/c buyrod' , '/c buyworms' at magazine !");
- SendClientMessage(playerid,COLOR_YELLOW,"For put the fishing rod in your hand type '/c rod' !");
- SendClientMessage(playerid,COLOR_YELLOW,"-----------Fishing Help-----------");
- return 1;
- }
- else if(strcmp(cmdtext, "rod", true) == 0) {
- if(boughtr[playerid] == 1) {
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtr[playerid] == 0) {
- SendClientMessage(playerid,COLOR_GREEN,"You don't have a fishing rod! Go to magazine to buy!");
- }
- return 1;
- }
- else if(strcmp(cmdtext, "buyrod", true) == 0) {
- if(PlayerToPoint(7, playerid, -712.7392, -1500.4816, 11.4436)) {
- new cash = GetPlayerMoney(playerid);
- if(boughtr[playerid] == 1) {
- SendClientMessage(playerid,COLOR_YELLOW,"Already have a fishing rod!");
- SendClientMessage(playerid,COLOR_YELLOW,"For put the rod in your hand type '/c rod' !");
- }
- if(boughtr[playerid] == 0) {
- if(cash >= 5000) {
- SendClientMessage(playerid,COLOR_YELLOW,"You bought a fishing rod!");
- GivePlayerWeapon(playerid,3,1);
- boughtr[playerid] = 1;
- DecPlayerHandCash(playerid, 5000);
- }
- if(cash < 5000) {
- SendClientMessage(playerid,COLOR_YELLOW,"Need more money ! Need $5000 for this rod!");
- }
- }
- }
- else
- {
- SendClientMessage(playerid,COLOR_YELLOW,"You not are at magazine!");
- }
- return 1;
- }
- else if(strcmp(cmdtext, "buyworms", true) == 0) {
- if(PlayerToPoint(7, playerid, -712.7392, -1500.4816, 11.4436)) {
- new cash = GetPlayerMoney(playerid);
- if(boughtw[playerid] > 0 && boughtw[playerid] < 10) {
- SendClientMessage(playerid,COLOR_YELLOW,"You have worms!");
- }
- if(boughtw[playerid] == 0) {
- if(cash >= 3000) {
- SendClientMessage(playerid,COLOR_YELLOW,"You bought 10 worms !");
- boughtw[playerid] = 10;
- DecPlayerHandCash(playerid, 3000);
- }
- if(cash < 3000) {
- SendClientMessage(playerid,COLOR_YELLOW,"Need more money ! Need $3000 for worms!");
- }
- }
- }
- else
- {
- SendClientMessage(playerid,COLOR_GREEN,"You not are at magazine!");
- }
- return 1;
- }
- else if(strcmp(cmdtext, "sellf", true) == 0) {
- new rand = random(sizeof(randomfish));
- if(hfish[playerid] == 0) {
- SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
- }
- if(hfish[playerid] == 1) {
- SendClientMessage(playerid,COLOR_YELLOW,"You sold your fish for money!");
- IncPlayerHandCash(playerid, randomfish[rand][mon]);
- hfish[playerid] = 0;
- }
- return 1;
- }
- else if(strcmp(cmdtext, "eatf", true) == 0) {
- new rand = random(sizeof(randomfish));
- new Float:Health;
- GetPlayerHealth(playerid,Health);
- if(hfish[playerid] == 0) {
- SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
- }
- if(hfish[playerid] == 1) {
- SendClientMessage(playerid,COLOR_YELLOW,"You ate your fish for health!");
- SetPlayerHealth(playerid,Health + randomfish[rand][hp]);
- hfish[playerid] = 0;
- }
- return 1;
- }
- else if(strcmp(cmdtext, "leavef", true) == 0) {
- if(hfish[playerid] == 0) {
- SendClientMessage(playerid,COLOR_GREEN,"You don't have a fish!");
- }
- if(hfish[playerid] == 1) {
- SendClientMessage(playerid,COLOR_YELLOW,"You want to live your fish, so.. say Bye!");
- SendClientMessage(playerid,COLOR_YELLOW,"The fish say: Thank You Very Much! Im so happy!");
- hfish[playerid] = 0;
- }
- return 1;
- }
- else if(strcmp(cmdtext, "fishing", true) == 0) {
- if(PlayerToPoint(30, playerid,-563.4057, -1514.9204, 4.8351 ) || PlayerToPoint(30, playerid,-600.0203, -1527.4523, 5.9322) || PlayerToPoint(30,playerid,-627.0029, -1516.8279, 8.1077) || PlayerToPoint(30,playerid,-580.3753, -1475.2249, 4.0794) || PlayerToPoint(30,playerid,-621.3587, -1459.5869, 3.7448)) {
- if(fishing[playerid] == 1) {
- SendClientMessage(playerid,COLOR_GREEN,"Already Fishing!");
- }
- if(fishing[playerid] == 0) {
- if(boughtr[playerid] == 0) {
- SendClientMessage(playerid,COLOR_GREEN,"Need rod for fishing! Go to magazine to buy!");
- }
- if(boughtr[playerid] == 1) {
- if(boughtw[playerid] == 0) {
- GameTextForPlayer(playerid,"~o~not have worms!");
- SendClientMessage(playerid,COLOR_GREEN,"Not have worms! Go to magazine to buy!");
- }
- if(boughtw[playerid] == 1) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 1 worm!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 0;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 2) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 1 worm!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 1;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 3) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 2 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 2;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 4) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 3 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 3;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 5) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 4 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 4;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 6) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 5 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 5;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 7) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 6 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 6;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 8) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 7 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 7;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 9) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 8 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 8;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- if(boughtw[playerid] == 10) {
- GameTextForPlayer(playerid,"~o~For a good job, type ~w~/aim ~o~!");
- SendClientMessage(playerid,COLOR_YELLOW,"Wait 5 seconds to find a fish!");
- SendClientMessage(playerid,COLOR_YELLOW,"Now, you have just 9 worms!");
- SetTimer("waitfish", 5000, false);
- fishing[playerid] = 1;
- boughtw[playerid] = 9;
- TogglePlayerControllable(playerid,0);
- GivePlayerWeapon(playerid,3,1);
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid,COLOR_GREEN,"You not are at port, on legal zone!");
- }
- return 1;
- }
- return 0;
- }
- public waitfish()
- {
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if (IsPlayerConnected(i)) {
- if(fishing[i]) {
- new rand = random(sizeof(randomfish));
- hfish[i] = randomfish[rand][fish];
- fishing[i] = 0;
- hfish[i] = randomfish[rand][fish];
- TogglePlayerControllable(i,1);
- GameTextForPlayer(i,"~b~Got something ! ~w~read ~b~pm !");
- SendClientMessage(i,COLOR_YELLOW,randomfish[rand][tfish]);
- if(hfish[i] == 0) {
- }
- if(hfish[i] == 1) {
- TogglePlayerControllable(i,1);
- GameTextForPlayer(i,"~b~Got something ! ~w~read ~b~pm !");
- SendClientMessage(i,COLOR_YELLOW,randomfish[rand][tfish]);
- SendClientMessage(i,COLOR_YELLOW,"You want to sell fish ? type '/c sellf' !");
- SendClientMessage(i,COLOR_YELLOW,"You want to eat fish ? type '/c eatf' !");
- SendClientMessage(i,COLOR_YELLOW,"You want to leave fish ? type '/c leavef' !");
- }
- }
- }
- }
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement