Fishing System Bugged
#1

So I have put a fishing system into my gamemode, the problem is i get to the Point where the command can be executed, and I get the return message "You are not at the fish shop" or "You are not at the fishing docks!"
I am a new scripter and really have no idea how I can fix it.


pawn Код:
CMD:sellfish(playerid, params[])
{
    new fishslot, string[256];
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160, -101, 2.76)) return SendClientMessage(playerid, white, "You are not at the fish shop!");
    if(sscanf(params, "i", fishslot)) return SendClientMessage(playerid, white, "Server: /sellfish [fish slot(1-4)]");
    {
        if(fishslot > 4 || fishslot < 1) return SendClientMessage(playerid, white, "Fish slots are from 1 - 4.");
        else
        {
            if(Fish[playerid][fishslot] > 1)
            {
                GivePlayerMoney(playerid, Fish[playerid][fishslot] * 2);
                format(string, sizeof(string), "You have sold a fish out of slot %d for $%d!", fishslot, Fish[playerid][fishslot] * 2);
                SendClientMessage(playerid, white, string);
                format(string, sizeof(string), "~g~+$%d", Fish[playerid][fishslot] * 2);
                GameTextForPlayer(playerid, string, 3000, 5);
            }
        }
    }
    return 1;
}
CMD:fishshop(playerid, params[])
{
  if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160, -101, 2.76)) return SendClientMessage(playerid, red, "You are not at the fish shop!");
  {
  ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Fish shop", "Fishing Rod($150)\nFishing Bait($5 for 10)", "Buy", "Cancel");
  }
  return 1;
}
CMD:fish(playerid, params[])
{
  if(IsPlayerInRangeOfPoint(playerid, 5.0, 2101.3228, -103.2982, 2.35)) return SendClientMessage(playerid, red, "You are not at the fishing docks!");
    {
        if(Fishing[playerid] == 1) return SendClientMessage(playerid, red, "You are already fishing!");
        if(Fish[playerid][1] >= 1 && Fish[playerid][2] >= 1 && Fish[playerid][3] >= 1 && Fish[playerid][4] >= 1) return SendClientMessage(playerid, white, "You have too many fish to fish again.");
        if(HasRod[playerid] == 1)
        {
            if(HasBait[playerid] == 1)
            {
                Fishing[playerid] = 1;
                SendClientMessage(playerid, white, "You have started to fish. Please wait 5 seconds.");
                SetTimerEx("FishCatchTimer", 5000, false, "i", playerid);
            }
            else return SendClientMessage(playerid, red, "You don't have any bait!");
        }
        else return SendClientMessage(playerid, red, "You haven't got a fishing rod!");
    }
    return 1;
}
Reply
#2

use this
pawn Код:
CMD:sellfish(playerid, params[])
{
    new fishslot, string[256];
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2160, -101, 2.76)) return SendClientMessage(playerid, white, "You are not at the fish shop!");
    if(sscanf(params, "i", fishslot)) return SendClientMessage(playerid, white, "Server: /sellfish [fish slot(1-4)]");
    if(fishslot > 4 || fishslot < 1) return SendClientMessage(playerid, white, "Fish slots are from 1 - 4.");
    if(Fish[playerid][fishslot] > 1)
    {
           GivePlayerMoney(playerid, Fish[playerid][fishslot] * 2);
           format(string, sizeof(string), "You have sold a fish out of slot %d for $%d!", fishslot, Fish[playerid][fishslot] * 2);
           SendClientMessage(playerid, white, string);
           format(string, sizeof(string), "~g~+$%d", Fish[playerid][fishslot] * 2);
           GameTextForPlayer(playerid, string, 3000, 5);
    }
    return 1;
}
CMD:fishshop(playerid, params[])
{
  if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2160, -101, 2.76)) return SendClientMessage(playerid, red, "You are not at the fish shop!");
  ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Fish shop", "Fishing Rod($150)\nFishing Bait($5 for 10)", "Buy", "Cancel");
  return 1;
}
CMD:fish(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2101.3228, -103.2982, 2.35)) return SendClientMessage(playerid, red, "You are not at the fishing docks!");
    if(Fishing[playerid] == 1) return SendClientMessage(playerid, red, "You are already fishing!");
    if(Fish[playerid][1] >= 1 && Fish[playerid][2] >= 1 && Fish[playerid][3] >= 1 && Fish[playerid][4] >= 1) return SendClientMessage(playerid, white, "You have too many fish to fish again.");
    if(HasRod[playerid] == 1)
    {
         if(HasBait[playerid] == 1)
         {
              Fishing[playerid] = 1;
              SendClientMessage(playerid, white, "You have started to fish. Please wait 5 seconds.");
              SetTimerEx("FishCatchTimer", 5000, false, "i", playerid);
          }
          else return SendClientMessage(playerid, red, "You don't have any bait!");
    }
    else return SendClientMessage(playerid, red, "You haven't got a fishing rod!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)