Fish cmds problem
#2

pawn Код:
COMMAND:fish(playerid, params[])
{
    if(IsAtFishPlace(playerid))
    {
        if(Died[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead.");
            return 1;
        }
        if(JustFished[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Please wait 4 seconds between each /fish. ");
            return 1;
        }
        if(PlayerInfo[playerid][pFish] == 20)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You can not carry anymore fish use /sellfish");
            return 1;
        }
        JustFished[playerid] = 1;
        SetTimerEx("FishReset", 4000, false, "i", playerid);
        new FishRand = random(9);
        if(FishRand == 0)
        {
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Pike");
            PlayerInfo[playerid][pFish] += 1;
        }
        if(FishRand == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
        }
        if(FishRand == 2)
        {
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Sardine");
            PlayerInfo[playerid][pFish] += 1;
        }
        if(FishRand == 3)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
        }
        if(FishRand == 4)
        {
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Sardine");
            PlayerInfo[playerid][pFish] += 1;
        }
        if(FishRand == 5)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
        }
        if(FishRand == 6)
        {
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Bass");
            PlayerInfo[playerid][pFish] += 1;
        }
        if(FishRand == 7)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You didn't catch anything.");
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught nothing.");
        }
        if(FishRand == 8)
        {
            PlayerActionMessage(playerid,15.0,"rolls back the line and caught a Bass");
            PlayerInfo[playerid][pFish] += 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
    return 1;
}
Indent your code properly next time...
Reply


Messages In This Thread
Fish cmds problem - by N0FeaR - 07.06.2012, 09:17
Re: Fish cmds problem - by JaKe Elite - 07.06.2012, 09:19
Re: Fish cmds problem - by N0FeaR - 07.06.2012, 09:23
Re: Fish cmds problem - by JaKe Elite - 07.06.2012, 09:28
Re: Fish cmds problem - by MadeMan - 07.06.2012, 09:31
Re: Fish cmds problem - by N0FeaR - 07.06.2012, 09:33

Forum Jump:


Users browsing this thread: 1 Guest(s)