VC:MP 0.3 > ShowRoom (pawn)

[FS] Fishing System v1 [By Me]

(1/4) > >>

sseebbyy:
Fishing System v1



With this system you can fishing on the port !

Commands:

/c fhelp => give all info with the fishing system !
/c buyrod  => work just on Fishing Shop ! With this command you buy a fishing rod !
/c buyworms => work just on Fishing Shop ! With this command you buy 10 worms !
/c rod => put your rod in your hand
/c fishing => fishing
/c sellf => you sell your fish for money
/c eatf => you eat your fish for health
/c leavef => you leave your fish and he say "Thank You"

For a good fishing type /aim =)

VIDEO: http://www.youtube.com/watch?v=_rkK_o53-TQ

[FilterScript] Fishing System -> Download[/ut

On Top:[/b]


--- Code: ---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();
--- End code ---

OnPlayerDisconnect:


--- Code: ---fishing[playerid] = 0;
boughtw[playerid] = 0;
boughtr[playerid] = 0;
hfish[playerid] = 0;
--- End code ---

Commands:


--- Code: ---else if(strcmp(cmd, "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 shop !");
    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(cmd, "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 shop to buy!");
}
return 1;
}
else if(strcmp(cmd, "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;
        SetPlayerMoney(playerid,GetPlayerMoney(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 shop!");
        }
    return 1;
}
else if(strcmp(cmd, "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;
            SetPlayerMoney(playerid,GetPlayerMoney(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 shop!");
}
return 1;
}
else if(strcmp(cmd, "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!");
    SetPlayerMoney(playerid,GetPlayerMoney(playerid) + randomfish[rand][mon]);
    hfish[playerid] = 0;
    }
    return 1;
    }
    else if(strcmp(cmd, "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(cmd, "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(cmd, "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 shop 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 shop 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;
    }
--- End code ---

On Player Death:


--- Code: ---fishing[playerid] = 0;
hfish[playerid] = 0;
--- End code ---

The New Public:


--- Code: ---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' !");
        }
        }
}
}
}
--- End code ---

This is ... Have Fun !

aledark24:
this filterscript is great only one problem.. not give real money so.. i cant use to roleplay
i remove the sellfish only give fake money  :'( , only use eat the fish for recovery energy :D

sseebbyy:

--- Quote from: aledark24 on July 30, 2012, 03:32:26 am ---this filterscript is great only one problem.. not give real money so.. i cant use to roleplay
i remove the sellfish only give fake money  :'( , only use eat the fish for recovery energy :D



--- End quote ---

You use GUPS right ?

I will come with an edit . I need to get the function of real money.

EDIT: 

You have here a link with Fishing System v1.0 for GUPS: http://pastebin.com/00GfMtXC

aledark24:

--- Quote from: sseebbyy on July 30, 2012, 11:50:43 am ---
--- Quote from: aledark24 on July 30, 2012, 03:32:26 am ---this filterscript is great only one problem.. not give real money so.. i cant use to roleplay
i remove the sellfish only give fake money  :'( , only use eat the fish for recovery energy :D



--- End quote ---

You use GUPS right ?

I will come with an edit . I need to get the function of real money.

EDIT: 

You have here a link with Fishing System v1.0 for GUPS: http://pastebin.com/00GfMtXC

--- End quote ---

 hem en realidad uso warchief pero modificado para roleplay :D vere que tal va la modificacion ya que me costo un monton intentar hacerlo que funcionara y no pude :D

sseebbyy:
Speak english please.

Navigation

[0] Message Index

[#] Next page

Go to full version