String not complete
#1

I have a fishing timer, but when I catch a Sea Bass it only shows it as "Sea B" or "Floun" (for Flounder) when I type /inventory.

Код:
new FishName[][] =
{
    {"LineSnap"},
    {"Trout"},
    {"Shark"},
    {"Tuna"},
    {"Flounder"},
    {"Sea Bass"}
};
Код:
forward public FishingTimer(playerid);
public FishingTimer(playerid)
{
    if(PlayerFishing[playerid] > 0)
    {
        new string[128];
        PlayerFishing[playerid] = 0;
        TogglePlayerControllable(playerid, 1);

        new rFish = random(sizeof(FishName));
        new randSize = randomEx(5, 118);
        if(strcmp(FishName[rFish], "LineSnap") == 0) // Line broken
        {
            format(string, sizeof(string), "%s's rod line has snapped!", GetName(playerid));
            SendActionMessage(string);
            return 1;
        }
        else
        {
        	if(strcmp(Player[playerid][FishSlot1], "None") == 0)
        	{
				Player[playerid][FishSize1] = randSize;
        		format(Player[playerid][FishSlot1], sizeof(FishName), "%s", FishName[rFish]);
			}
			else
			{
			    Player[playerid][FishSize2] = randSize;
				format(Player[playerid][FishSlot2], sizeof(FishName), "%s", FishName[rFish]);
			}
			format(string, sizeof(string), "You have caught a %dlb %s!", randSize, FishName[rFish]);
			SendClientMessage(playerid, -1, string);
        }
    }
    return 1;
}
Код:
CMD:inventory(playerid, params[])
{
	if(Player[playerid][IsLoggedIn] == false) return 0;

	new string[250];
    SendClientMessage(playerid, -1, ""COLOR_GREY"-- Inventory --");
 	format(string, sizeof(string), ""COLOR_WHITE"(Cash: $%d) (Lighter: %d percent) (Cigarettes: %d)", GetCash(playerid), Player[playerid][Lighter], Player[playerid][Cigs]);
 	format(string, sizeof(string), ""COLOR_WHITE"(Fish Slot 1: %dlb %s) (Fish Slot 2: %dlb %s)", Player[playerid][FishSize1], Player[playerid][FishSlot1], Player[playerid][FishSize2], Player[playerid][FishSlot2]);
	SendClientMessage(playerid, -1, string);
	return 1;
}
Reply


Messages In This Thread
String not complete - by DevBe - 05.11.2017, 01:26
Re: String not complete - by StrikerZ - 05.11.2017, 04:55
Re: String not complete - by Konstantinos - 05.11.2017, 08:52

Forum Jump:


Users browsing this thread: 1 Guest(s)