Fishing Script Problem
#1

Hey guys, I just started editing a fishing script and I got some problem with it. Compiles correctly but in game it keeps telling me : You are not on a boat standing near blue algae

Код:
CMD:seafish(playerid, params[])
{
	new string[128], done, fish;
   	if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
 	if(!IsAtFishingSpot2(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not on a boat standing near blue algae");
	if(FishTime[playerid])
	{
	    format(string, sizeof(string), "You need to wait %d more seconds before fishing again.", FishTime[playerid]);
		SendClientMessage(playerid, COLOR_GREY, string);

	    return 1;
	}
	for(new i=0; i<5; i++) // Fish
	{
	    if(!done)
	    {
		    if(!PlayerInfo[playerid][pFish][i]) done = i+1;
	    }
	}
	if(!done) return SendClientMessage(playerid, COLOR_GREY, "You can't carry anymore fishes.");
	done = done-1;
	// Catching
	if(strval(RPJL(playerid, JOB_FISHER)) == 1) fish = random(35)+1;
	else if(strval(RPJL(playerid, JOB_FISHER)) == 2) fish = random(41)+5;
	else if(strval(RPJL(playerid, JOB_FISHER)) == 3) fish = random(46)+10;
	else if(strval(RPJL(playerid, JOB_FISHER)) == 4) fish = random(51)+15;
	else if(strval(RPJL(playerid, JOB_FISHER)) == 5) fish = random(60)+25;
	PlayerInfo[playerid][pFish][done] = fish;
	format(string, sizeof(string), "* %s attempts to catch a fish using the fishing rod.", RPN(playerid));
 	SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	format(string, sizeof(string), " You have caught a %d lbs fish.", fish);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	// Leveling
    new oldj = strval(RPJL(playerid, JOB_FISHER));
    PlayerInfo[playerid][pJobSkill][JOB_FISHER] ++;
	new newj = strval(RPJL(playerid, JOB_FISHER));
    if(oldj < newj)
	{
	    format(string, sizeof(string), "** Your Fisher level is now %d, you can now catch heavier fishes. **", newj);
		SendClientMessage(playerid, COLOR_YELLOW, string);
	}
	Fished[playerid] ++;
	if(Fished[playerid] >= 5)
	{
		Fished[playerid] = 0;
		FishTime[playerid] = 600*5;
		SetTimerEx("FishingTime", 10000, false, "i", playerid);
	}
	return 1;
}
Oh yeah and IsAtFishingSpot2 refers to this

Код:
stock IsAtFishingSpot2(playerid)
{
 	if(IsPlayerInRangeOfPoint(playerid, 40, 2315.3904,-0.0501,26.7422)) return 1;
	return 0;
}
Your help always is appreciated ! Thanks

Edit : I am standing right at the position and.. it has a pretty good range so i doubt its that..
Reply
#2

try to replace your stock with this

PHP код:
forward IsAtFishingSpot2(playerid);
public 
IsAtFishingSpot2(playerid)
{
     if(
IsPlayerInRangeOfPoint(playerid402315.3904,-0.0501,26.7422))
    { return 
true; }
    return 
false;

Reply
#3

Hey Ice , I tried and everything compiles, but it keeps telling me the same thing. I /drop my fishes so i could get new ones, I wonder if its not the radius of 40 that isnt enough since im on boat. (playerid, 40, 2315.3904,-0.0501,26.7422))
thanks for your quick answer btw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)