Invalid expression
#1

If somebody can help me with this will be very good for me
thanks


pawn Код:
forward Fishing(playerid);
public Fishing(playerid)
{
    new string[1024];
    if(IsPlayerConnected(playerid))
    {
        new weight = randomEx(1000,1800);
        new money = randomEx(100, 300);
        new rand = randomEx(1, 7);
        new fish = random(FishNames);
       
        if(rand == 1)
        {
            SendClientMessage(playerid,0x2641FEAA,"You just caught some trash in your net and throwed it back in sea");
            IsFishing[playerid] = 0;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 2)
        {
            format(string, sizeof(string),"You just caught in your net a %s, %s, %s.", randfish(fish), randfish(fish), randfish(fish)); // Here
            SendClientMessage(playerid, 0x2641FEAA, string);
            Fishes[playerid] += 3;
            IsFishing[playerid] = 0;
            FishWeight[playerid] += weight;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 3)
        {
            format(string, sizeof(string), "You just caught in your net a %s, %s, %s, %s.", randfish(fish), randfish(fish), randfish(fish), randfish(fish));
            SendClientMessage(playerid, 0x2641FEAA, string);
            Fishes[playerid] += 4;
            IsFishing[playerid] = 0;
            FishWeight[playerid] += weight;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 4)
        {
            format(string, sizeof(string), "You just caught in your net a %s, %s, %s, %s, %s.", randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish));
            SendClientMessage(playerid, 0x2641FEAA, string);
            Fishes[playerid] += 5;
            IsFishing[playerid] = 0;
            FishWeight[playerid] += weight;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 5)
        {
            format(string, sizeof(string), "You just caught in your net a %s, %s, %s, %s, %s, s%.", randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish));
            SendClientMessage(playerid, 0x2641FEAA, string);
            Fishes[playerid] += 6;
            IsFishing[playerid] = 0;
            FishWeight[playerid] += weight;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 6)
        {
            format(string, sizeof(string), "You just caught in your net a %s, %s, %s, %s, %s, s%, %s.", randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish), randfish(fish));
            SendClientMessage(playerid, 0x2641FEAA, string);
            Fishes[playerid] += 7;
            IsFishing[playerid] = 0;
            FishWeight[playerid] += weight;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
        else if(rand == 7)
        {
            format(string, sizeof(string), "You just caught in your net a money backpack with $%d in it.", money);
            SendClientMessage(playerid, 0x2641FEAA, string);
            GivePlayerMoney(playerid, money);
            IsFishing[playerid] = 0;
            TogglePlayerControllable(playerid,true);
            return 1;
        }
    }
    return 0;
}
Reply
#2

Show us the line(S), and use 128 cells.

pawn Код:
new string[1024];
Reply
#3

Okay,

Here is the line

Код:
format(string, sizeof(string),"You just caught in your net a %s, %s, %s.", randfish(fish), randfish(fish), randfish(fish)); // Here
Reply
#4

You added two commas,
pawn Код:
net a %s, %s, %s.", , randfish(fish), randfish(fish), randfish(fish)); // Here
Remove one.

It should be:

pawn Код:
format(string, sizeof(string),"You just caught in your net a %s, %s, %s.", randfish(fish), randfish(fish), randfish(fish));
Reply
#5

I solved it.
I have problem here randfish(fish), it must be randfish[fish]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)