I got a nice idea for my server because i got a lot of people who likes to go fishing ecc...
I am using La-rp... and i want to do that so you can fish you have to buy bait but i want it that when you log off the bait is gone not like the fishing rod it stays there. And i made the limit you can fish per few minutes is 15 but you have to throw back the 5 fish you cought so you can catch another 10 can some one help me do that you can hold up to 15 fish with out /throwbackfish.
Код:
if(strcmp(cmd,"/fish",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pRod] != 1)
{
SendClientMessage(playerid, COLOR_RED, " You don't have a fishing Rod with you !");
return 1;
}
if(PlayerInfo[playerid][pFishes] > 15)
{
SendClientMessage(playerid, COLOR_GREEN, " Your Bucket is full throw back the unwanted fish...");
return 1;
}
// if(Fishes[playerid][pWeight1] > 0 && Fishes[playerid][pWeight2] > 0 && Fishes[playerid][pWeight3] > 0 && Fishes[playerid][pWeight4] > 0 && Fishes[playerid][pWeight5]
//{
// SendClientMessage(playerid, COLOR_LIGHTGREEN, " You already caught 50 Fishes, sell / eat / release them first, before you go fish again!");
// return 1;
//}
new Veh = GetPlayerVehicleID(playerid);
if((IsAtFishPlace(playerid)) || IsABoat(Veh))
{
new Caught;
new rand;
new fstring[MAX_PLAYER_NAME];
new Level = PlayerInfo[playerid][pFishSkill];
if(Level >= 0 && Level <= 50) { Caught = random(20)-7; }
else if(Level >= 51 && Level <= 100) { Caught = random(50)-20; }
else if(Level >= 101 && Level <= 200) { Caught = random(100)-50; }
else if(Level >= 201 && Level <= 400) { Caught = random(160)-60; }
else if(Level >= 401) { Caught = random(180)-70; }
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 a Pants and threw it away !");
return 1;
}
else if(rand == 7)
{
SendClientMessage(playerid, COLOR_RED, " You caught a Can and threw it away !");
return 1;
}
else if(rand == 10)
{
SendClientMessage(playerid, COLOR_RED, " You caught a pair of Shoes and threw it away !");
return 1;
}
else if(rand == 13)
{
SendClientMessage(playerid, COLOR_RED, " You caught some Garbage and threw it away !");
return 1;
}
else if(rand == 20)
{
new mrand = random(250);
format(string, sizeof(string), "* You caught a Money Bag, containing $%d.", mrand);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(playerid, mrand);
return 1;
}
if(PlayerInfo[playerid][pFishLic] < 1)
{
WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Illegal Fishing");
}
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 weights %d Lbs.", Fishes[playerid][pFish1], Caught);
SendClientMessage(playerid, COLOR_WHITE, 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_WHITE, 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 weights %d Lbs.", Fishes[playerid][pFish2], Caught);
SendClientMessage(playerid, COLOR_WHITE, 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_WHITE, 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 weights %d Lbs.", Fishes[playerid][pFish3], Caught);
SendClientMessage(playerid, COLOR_WHITE, 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_WHITE, 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 weights %d Lbs.", Fishes[playerid][pFish4], Caught);
SendClientMessage(playerid, COLOR_WHITE, 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_WHITE, 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 weights %d Lbs.", Fishes[playerid][pFish5], Caught);
SendClientMessage(playerid, COLOR_WHITE, 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_WHITE, 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_GREY, " You are not at a Fishing Place (Big Wheel Rods) or on a Fishing Boat !");
return 1;
}
}
return 1;
}
i added fishing biat in 24/7 ecc and when you go fishing and do /fish it says you don't got fishing bait but when i go to 24/7 and click on fishing bait noting happens what i have to do?