19.07.2016, 11:13
Hello, can anyone help me to make this?
i want it to be like, there is about 15-25percent chance to catch weapons, and other stuff.
and like 60-70 percent chance to catch a normal fish? i really hope that anyone want to help me
rep+
i want it to be like, there is about 15-25percent chance to catch weapons, and other stuff.
and like 60-70 percent chance to catch a normal fish? i really hope that anyone want to help me
rep+
pawn Код:
if(PRESSED(KEY_AIM))
{
if (FishCaught[playerid] == 1)
{
if(IsPlayerNearWater(playerid) || IsPlayerInWater(playerid))
{
//if(Fishing[playerid] == 1)
{
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 >= 50 && Level < 100) { Caught = random(50)-20; }
else if(Level >= 100 && Level < 200) { Caught = random(100)-50; }
else if(Level >= 200 && Level < 400) { Caught = random(140)-60; } // 24
else if(Level >= 400 && Level < 500) { Caught = random(170)-60; }
rand = random(FishNamesNumber);
if(rand == 3) //
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 27);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a Combat Shotgun.", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 24);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a Desert Eagle.", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 31);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in an M4.", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 30);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in an AK 47.", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 22);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a Colt 45.", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You caught a headcrab and threw it away!");
HidePlayerFishText(playerid);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You caught a g-string and threw it away!");
HidePlayerFishText(playerid);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You caught a can and threw it away!");
HidePlayerFishText(playerid);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You caught a used condom and threw it away!");
HidePlayerFishText(playerid);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You caught some garbage and threw it away!");
HidePlayerFishText(playerid);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
HidePlayerFishText(playerid);
PlayerInfo[playerid][pIntoxication] += ( 4000 + floatround( floatpower(PlayerInfo[playerid][pIntoxication],0.9) ) );
if(PlayerInfo[playerid][pIntoxication] > 50000) PlayerInfo[playerid][pIntoxication] = 50000;
SetPlayerDrunkLevel(playerid,PlayerInfo[playerid][pIntoxication]);
format(string, sizeof(string), "* %s reels in a six-pack with 4 beers left!", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
PlayerInfo[playerid][pFishSkill] += 1;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new randgrams = 2 + random(10);
HidePlayerFishText(playerid);
PlayerInfo[playerid][pPot] += randgrams;
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a small bag containing %d grams of pot!", RemoveUnderScore(playerid), randgrams);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new randgrams = 2 + random(10);
HidePlayerFishText(playerid);
PlayerInfo[playerid][pCrack] += randgrams;
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a small bag containing %d grams of crack!", RemoveUnderScore(playerid), randgrams);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3) //
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 23);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in an SD Pistol!", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 5);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a Bat!", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new Float:x, Float:y, Float:z;
HidePlayerFishText(playerid);
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 1, 3.0); // 5
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in an undetonated sea mine!", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new mrand = random(2000);
HidePlayerFishText(playerid);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a money bag, containing $%d!", RemoveUnderScore(playerid), mrand);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GiveMoney(playerid, mrand);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
else if(rand == 3)
{
new string[85];
new weapon[MAX_PLAYERS];
HidePlayerFishText(playerid);
AddWeapon(playerid,weapon[playerid] = 7);
PlayerInfo[playerid][pFishSkill] += 1;
format(string, sizeof(string), "* %s reels in a Pool cue!", RemoveUnderScore(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
KillTimer(fishtimer[playerid]);
return 1;
}
if(PlayerInfo[playerid][pFishLic] < 1)
{
}
if(Fishes[playerid][pWeight1] == 0)
{
new string[85];
HidePlayerFishText(playerid);
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), "* %s reels in a %s weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish1], Caught);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
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), "* You've beaten your old record of %d pounds! Your new biggest fish is: %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pBiggestFish] = Caught;
}
}
else if(Fishes[playerid][pWeight2] == 0)
{
new string[85];
HidePlayerFishText(playerid);
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), "* %s reels in a %s weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish2], Caught);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
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), "* You've beaten your old record of %d pounds! Your new biggest fish is: %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pBiggestFish] = Caught;
}
}
else if(Fishes[playerid][pWeight3] == 0)
{
new string[85];
HidePlayerFishText(playerid);
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), "* %s reels in a %s, weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish3], Caught);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
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), "* You've beaten your old record of %d pounds! Your new biggest fish is: %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pBiggestFish] = Caught;
}
}
else if(Fishes[playerid][pWeight4] == 0)
{
new string[85];
HidePlayerFishText(playerid);
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), "* %s reels in a %s weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish4], Caught);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
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), "* You've beaten your old record of %d pounds! Your new biggest fish is: %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pBiggestFish] = Caught;
}
}
else if(Fishes[playerid][pWeight5] == 0)
{
new string[85];
HidePlayerFishText(playerid);
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), "* %s reels in a %s weighing %d lbs!", RemoveUnderScore(playerid), Fishes[playerid][pFish5], Caught);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid,0);
KillTimer(fishtimer[playerid]);
FishCaught[playerid] = 0;
Fishing[playerid] = 0;
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), "* You've beaten your old record of %d pounds! Your new biggest fish is: %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[playerid][pBiggestFish] = Caught;
}
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;
}