SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/11/2011, 01:10 AM   #1
Medardo4Life
Big Clucker
 
Medardo4Life's Avatar
 
Join Date: Nov 2009
Posts: 107
Reputation: 9
Default A more realistic fishing experience

instead of the the same /fish, stand still instantly get fishing weight. blah blah


pawn Code:
if(strcmp(cmd,"/fish",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFishes] > 5)
            {
                SendClientMessage(playerid, COLOR_RED, "   You Hit the Fishing Cooldown! Go do something else!!");
                return 1;
            }
            if(Fishes[playerid][pWeight1] > 0 && Fishes[playerid][pWeight2] > 0 && Fishes[playerid][pWeight3] > 0 && Fishes[playerid][pWeight4] > 0 && Fishes[playerid][pWeight5] > 0)
            {
                SendClientMessage(playerid, COLOR_RED, "   You can't carry more than 5 Fish, sell or release them first!");
                return 1;
            }
            new Veh = GetPlayerVehicleID(playerid);
            if(GetVehicleModel(Veh) == 453)
            {
                if(IsAtFishPlace(playerid))
                {
                    new Caught;
                    new rand;
                    new fstring[MAX_PLAYER_NAME];
                    new Level = PlayerInfo[playerid][pFishSkill];
                    if(Level >= 0 && Level <= 49) { Caught = random(150)+70; }
                    else if(Level >= 50 && Level <= 249) { Caught = random(200)+100; }
                    else if(Level >= 250 && Level <= 499) { Caught = random(230)+200; }
                    else if(Level >= 500 && Level <= 999) { Caught = random(270)+300; }
                    else if(Level >= 1000) { Caught = random(300)+400; }
                    rand = random(FishNamesNumber);
                    if(Caught <= 0)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   Line snapped!");
                        return 1;
                    }
                    else if(rand == 0)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   You caught a Jacket and threw it away!");
                        return 1;
                    }
                    else if(rand == 4)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   You caught some Pants and threw them away!");
                        return 1;
                    }
                    else if(rand == 7)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   You caught a Used Condom and threw it away!");
                        return 1;
                    }
                    else if(rand == 10)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   You caught a broken Dildo and threw it away!");
                        return 1;
                    }
                    else if(rand == 13)
                    {
                        SendClientMessage(playerid, COLOR_RED, "   You caught a Corpse and threw it away!");
                        return 1;
                    }
                    else if(rand == 20)
                    {
                        new mrand = random(2000);
                        format(string, sizeof(string), "* You caught a Money Bag, containing $%d.", mrand);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+mrand;
                        GivePlayerMoney(playerid, mrand);
                        return 1;
                    }
                    if(Fishes[playerid][pWeight1] == 0)
                    {
                        PlayerInfo[playerid][pFishes] += 1;
                        PlayerInfo[playerid][pFishSkill] += 1;
                        format(fstring, sizeof(fstring), "%s", FishNames[rand]);
                        strmid(Fishes[playerid][pFish1], fstring, 0, strlen(fstring), 255);
                        Fishes[playerid][pWeight1] = Caught;
                        format(string, sizeof(string), "* You have caught a %s, which weighs %d Lbs.", Fishes[playerid][pFish1], Caught);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        Fishes[playerid][pLastWeight] = Caught;
                        Fishes[playerid][pLastFish] = 1;
                        Fishes[playerid][pFid1] = rand;
                        Fishes[playerid][pFishID] = rand;
                        if(Caught > PlayerInfo[playerid][pBiggestFish])
                        {
                            format(string, sizeof(string), "* Your old record of %d Lbs has been passed, your new Biggest Fish is: %d Lbs.", PlayerInfo[playerid][pBiggestFish], Caught);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            PlayerInfo[playerid][pBiggestFish] = Caught;
                        }
                    }
                    else if(Fishes[playerid][pWeight2] == 0)
                    {
                        PlayerInfo[playerid][pFishes] += 1;
                        PlayerInfo[playerid][pFishSkill] += 1;
                        format(fstring, sizeof(fstring), "%s", FishNames[rand]);
                        strmid(Fishes[playerid][pFish2], fstring, 0, strlen(fstring), 255);
                        Fishes[playerid][pWeight2] = Caught;
                        format(string, sizeof(string), "* You have caught a %s, which weighs %d Lbs.", Fishes[playerid][pFish2], Caught);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        Fishes[playerid][pLastWeight] = Caught;
                        Fishes[playerid][pLastFish] = 2;
                        Fishes[playerid][pFid2] = rand;
                        Fishes[playerid][pFishID] = rand;
                        if(Caught > PlayerInfo[playerid][pBiggestFish])
                        {
                            format(string, sizeof(string), "* Your old record of %d Lbs has been passed, your new Biggest Fish is: %d Lbs.", PlayerInfo[playerid][pBiggestFish], Caught);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            PlayerInfo[playerid][pBiggestFish] = Caught;
                        }
                    }
                    else if(Fishes[playerid][pWeight3] == 0)
                    {
                        PlayerInfo[playerid][pFishes] += 1;
                        PlayerInfo[playerid][pFishSkill] += 1;
                        format(fstring, sizeof(fstring), "%s", FishNames[rand]);
                        strmid(Fishes[playerid][pFish3], fstring, 0, strlen(fstring), 255);
                        Fishes[playerid][pWeight3] = Caught;
                        format(string, sizeof(string), "* You have caught a %s, which weighs %d Lbs.", Fishes[playerid][pFish3], Caught);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        Fishes[playerid][pLastWeight] = Caught;
                        Fishes[playerid][pLastFish] = 3;
                        Fishes[playerid][pFid3] = rand;
                        Fishes[playerid][pFishID] = rand;
                        if(Caught > PlayerInfo[playerid][pBiggestFish])
                        {
                            format(string, sizeof(string), "* Your old record of %d Lbs has been passed, your new Biggest Fish is: %d Lbs.", PlayerInfo[playerid][pBiggestFish], Caught);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            PlayerInfo[playerid][pBiggestFish] = Caught;
                        }
                    }
                    else if(Fishes[playerid][pWeight4] == 0)
                    {
                        PlayerInfo[playerid][pFishes] += 1;
                        PlayerInfo[playerid][pFishSkill] += 1;
                        format(fstring, sizeof(fstring), "%s", FishNames[rand]);
                        strmid(Fishes[playerid][pFish4], fstring, 0, strlen(fstring), 255);
                        Fishes[playerid][pWeight4] = Caught;
                        format(string, sizeof(string), "* You have caught a %s, which weighs %d Lbs.", Fishes[playerid][pFish4], Caught);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        Fishes[playerid][pLastWeight] = Caught;
                        Fishes[playerid][pLastFish] = 4;
                        Fishes[playerid][pFid4] = rand;
                        Fishes[playerid][pFishID] = rand;
                        if(Caught > PlayerInfo[playerid][pBiggestFish])
                        {
                            format(string, sizeof(string), "* Your old record of %d Lbs has been passed, your new Biggest Fish is: %d Lbs.", PlayerInfo[playerid][pBiggestFish], Caught);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            PlayerInfo[playerid][pBiggestFish] = Caught;
                        }
                    }
                    else if(Fishes[playerid][pWeight5] == 0)
                    {
                        PlayerInfo[playerid][pFishes] += 1;
                        PlayerInfo[playerid][pFishSkill] += 1;
                        format(fstring, sizeof(fstring), "%s", FishNames[rand]);
                        strmid(Fishes[playerid][pFish5], fstring, 0, strlen(fstring), 255);
                        Fishes[playerid][pWeight5] = Caught;
                        format(string, sizeof(string), "* You have caught a %s, which weighs %d Lbs.", Fishes[playerid][pFish5], Caught);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        Fishes[playerid][pLastWeight] = Caught;
                        Fishes[playerid][pLastFish] = 5;
                        Fishes[playerid][pFid5] = rand;
                        Fishes[playerid][pFishID] = rand;
                        if(Caught > PlayerInfo[playerid][pBiggestFish])
                        {
                            format(string, sizeof(string), "* Your old record of %d Lbs has been passed, your new Biggest Fish is: %d Lbs.", PlayerInfo[playerid][pBiggestFish], Caught);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            PlayerInfo[playerid][pBiggestFish] = Caught;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You dont have any space for your Fish!");
                        return 1;
                    }
                    if(PlayerInfo[playerid][pFishSkill] == 50)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 2, you can now catch Heavier Fishes."); }
                    else if(PlayerInfo[playerid][pFishSkill] == 250)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 3, you can now catch Heavier Fishes."); }
                    else if(PlayerInfo[playerid][pFishSkill] == 500)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 4, you can now catch Heavier Fishes."); }
                    else if(PlayerInfo[playerid][pFishSkill] == 1000)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 5, you can now catch Heavier Fishes."); }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "   You are not in at the fishing spot!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "   You are not in a fishing boat!  /FindPort to find fishing boats");
                return 1;
            }
        }
        return 1;
    }

Disregard the
pawn Code:
new Veh = GetPlayerVehicleID(playerid);
           if(GetVehicleModel(Veh) == 453)
, since i will remove that, and implement the standing/animation/fishing.

I would like to see if i could make the player do a fishing animation for 5 seconds with a fishing rod then you get the fishing result. making sure that the player cant spam /fish and get his inventory filled quick. could anyone code in the changes?
__________________
Me if you like my posts :P
Medardo4Life is offline   Reply With Quote
Old 23/11/2011, 01:19 AM   #2
Steven82
High-roller
 
Join Date: Nov 2009
Posts: 2,431
Reputation: 186
Default Re: A more realistic fishing experience

Quote:
Originally Posted by Medardo4Life View Post
instead of the the same /fish, stand still instantly get fishing weight. blah blah
I would like to see if i could make the player do a fishing animation for 5 seconds with a fishing rod...
Quote:
Originally Posted by Medardo4Life View Post
Could anyone code in the changes?
Your statement and question are conflicting.
__________________
If you read my old posts; I apologize in advance.
Steven82 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fishing help 26_RUSSS Scripting Help 6 16/11/2011 12:08 PM
fishing help sggassasin Help Archive 2 09/12/2009 08:29 AM
fishing StrickenKid Help Archive 1 25/02/2009 01:59 PM


All times are GMT. The time now is 11:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.