26.07.2016, 08:41
How to make that the fish weight becomes larger the longer you are out in the ocean?
pawn Код:
if(PRESSED(KEY_AIM))
{
if (FishCaught[playerid] == 1)
{
if(IsPlayerNearWater(playerid) || IsPlayerInWater(playerid))
{
//if(Fishing[playerid] == 1)
{
new Caught;
new rand;
new luck = Random(1, 100);
new fstring[MAX_PLAYER_NAME];
new Level = PlayerInfo[playerid][pFishSkill];
if(Level >= 0 && Level < 50) { Caught = random((20 - 7 + 1)) + 7; }
else if(Level >= 50 && Level < 100) { Caught = random((50 - 20 + 1)) + 20; }
else if(Level >= 100 && Level < 200) { Caught = random((75 - 50 + 1)) + 50; }
else if(Level >= 200 && Level < 400) { Caught = random((87 - 60 + 1)) + 60; }
else if(Level >= 400 && Level < 500) { Caught = random((105 - 60 + 1)) + 60; }
else if(Level >= 500) { Caught = random((120 - 60 + 1)) + 60; }
rand = random(FishNamesNumber);
if(luck <= 99)
{
if(Fishes[playerid][pWeight] == 0)
{
new string[85];
HidePlayerFishText(playerid);
PlayerInfo[playerid][pFishes] += 1;
Fishes[playerid][pFishHold] = 1;
PlayerInfo[playerid][pFishSkill] += 1;
format(fstring, sizeof(fstring), "%s", FishNames[rand]);
strmid(Fishes[playerid][pFish], fstring, 0, strlen(fstring), 255);
format(string, sizeof(string), "* %s reels in a %s weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish], Caught);
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
Fishes[playerid][pWeight] = Caught;
Fishes[playerid][pLastFish] = 2;
Fishes[playerid][pFishPrice] = rand;
Fishes[playerid][pFishID] = rand;
}
return 1;
}
if(PlayerInfo[playerid][pFishSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your fishing skill is now level 2."); }
else if(PlayerInfo[playerid][pFishSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your fishing skill is now level 3."); }
else if(PlayerInfo[playerid][pFishSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your fishing skill is now level 4."); }
else if(PlayerInfo[playerid][pFishSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your fishing skill is now level 5."); }
else if(PlayerInfo[playerid][pFishSkill] == 700)
{ SendClientMessage(playerid, COLOR_YELLOW, "* The fish gods are mad at you!. You no longer can catch fish."); }
}
}
}
}
return 1;
}