Filterscript Error
#1

Error:
Код:
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(371) : warning 209: function "OnPlayerCommandText" should return a value
Filterscript:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new cmd[256], idx;
        cmd = strtok(cmdtext, idx);
        if(strcmp(cmd, "/duel", true) == 0)
        {
            SendClientMessage(playerid, COLOR_LIST_HEADER, ""#HEADER" Help for Advance Duel System:");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" "#USAGE_DUEL" - create duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelj [duel ID] - join to duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueldec - decline duel invite");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueld - delete duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duell - list of locations");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelw - list of aviable weapons");
        return 1;
        }
        else if(strcmp(cmd, "/duelh", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    new tmp1[TMP_SIZE];
                    new tmp2[TMP_SIZE];
                    new tmp3[TMP_SIZE];
                    new tmp4[TMP_SIZE];
                    new tmp5[TMP_SIZE];
                    new inv = INVALID_PLAYER_ID;
                        tmp1 = strtok(cmdtext, idx);
                        tmp2 = strtok(cmdtext, idx);
                        tmp3 = strtok(cmdtext, idx);
                        tmp4 = strtok(cmdtext, idx);
                        tmp5 = strtok(cmdtext, idx);
                        if(strlen(tmp5) == 0) inv = INVALID_PLAYER_ID;
                        else inv = strval(tmp5);
                new errorid = CreateDuel(playerid,strval(tmp1),strval(tmp2),strval(tmp3),strval(tmp4),inv);
                        switch(errorid)
                        {
                            case -8: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" All duels ("#MAX_DUELS") already created. Wait please"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong location ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -5: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player is disconnected"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                                case -6: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player already on duel"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                                case -7: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible invite youself"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                        }
            }
            else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already created duel");
                return 1;
        }
        else if(strcmp(cmd, "/duelj", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0 || (duelid != 0 && Duel[duelid][dStarted] != 1))
            {
                    new tmp1[TMP_SIZE];
                        tmp1 = strtok(cmdtext, idx);
                        if(strval(tmp1) <= 0)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong duel ID");
                        }
                        else
                        {
                            if(duelid != 0 && Duel[duelid][dInvitedID] != playerid && Duel[duelid][dStarted] != 1) ResetDuelVariables(duelid);
                        new errorid = StartDuel(playerid,strval(tmp1));
                                switch(errorid)
                                {
                                    case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This duel ID hasn't been created. Create your duel by /duelh");
                                    case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" On this duel ID already playing. Create your duel by /duelh");
                                    case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This is private duel ID. Create different duel by /duelh");
                                }
                        }
            }
            else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already on duel");
        return 1;
        }
        else if(strcmp(cmd, "/dueldec", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You uninvited. Create your duel by /duelh");
            }
            else
            {
                        if(Duel[duelid][dStarted] == 1)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible decline duel, when she has been started");
                        }
                        else
                        {
                            format(string, sizeof(string), "%s decline invite to duel. Duel was deleted", PlayerName[playerid]);
                            SendClientMessage(Duel[duelid][dHosterID], COLOR_DUEL, string);
                                ResetDuelVariables(duelid);
                            SendClientMessage(playerid, COLOR_DUEL, "You decline invite to duel");
                        }
            }
        return 1;
        }
        else if(strcmp(cmd, "/dueld", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You haven't duel. Create your duel by /duelh");
            }
            else
            {
                        if(Duel[duelid][dStarted] == 1)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible delete duel, when she has been started");
                        }
                        else
                        {
                                ResetDuelVariables(duelid);
                            format(string, sizeof(string), "%s delete duel (ID: %d)", PlayerName[playerid], duelid);
                            SendClientMessageToAll(COLOR_DUEL, string);
                        }
            }
                return 1;
        }
Reply
#2

At the end:
pawn Код:
return 0;
}
Reply
#3

There are 20 opening '{' brackets and 19 closing '}' brackets. Check your brackets.
Reply
#4

I guess you need a return 0 thing.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new cmd[256], idx;
        cmd = strtok(cmdtext, idx);
        if(strcmp(cmd, "/duel", true) == 0)
        {
            SendClientMessage(playerid, COLOR_LIST_HEADER, ""#HEADER" Help for Advance Duel System:");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" "#USAGE_DUEL" - create duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelj [duel ID] - join to duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueldec - decline duel invite");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueld - delete duel");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duell - list of locations");
            SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelw - list of aviable weapons");
        return 1;
        }
        else if(strcmp(cmd, "/duelh", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    new tmp1[TMP_SIZE];
                    new tmp2[TMP_SIZE];
                    new tmp3[TMP_SIZE];
                    new tmp4[TMP_SIZE];
                    new tmp5[TMP_SIZE];
                    new inv = INVALID_PLAYER_ID;
                        tmp1 = strtok(cmdtext, idx);
                        tmp2 = strtok(cmdtext, idx);
                        tmp3 = strtok(cmdtext, idx);
                        tmp4 = strtok(cmdtext, idx);
                        tmp5 = strtok(cmdtext, idx);
                        if(strlen(tmp5) == 0) inv = INVALID_PLAYER_ID;
                        else inv = strval(tmp5);
                new errorid = CreateDuel(playerid,strval(tmp1),strval(tmp2),strval(tmp3),strval(tmp4),inv);
                        switch(errorid)
                        {
                            case -8: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" All duels ("#MAX_DUELS") already created. Wait please"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong location ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                            case -5: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player is disconnected"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                                case -6: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player already on duel"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                                case -7: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible invite youself"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                        }
            }
            else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already created duel");
                return 1;
        }
        else if(strcmp(cmd, "/duelj", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0 || (duelid != 0 && Duel[duelid][dStarted] != 1))
            {
                    new tmp1[TMP_SIZE];
                        tmp1 = strtok(cmdtext, idx);
                        if(strval(tmp1) <= 0)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong duel ID");
                        }
                        else
                        {
                            if(duelid != 0 && Duel[duelid][dInvitedID] != playerid && Duel[duelid][dStarted] != 1) ResetDuelVariables(duelid);
                        new errorid = StartDuel(playerid,strval(tmp1));
                                switch(errorid)
                                {
                                    case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This duel ID hasn't been created. Create your duel by /duelh");
                                    case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" On this duel ID already playing. Create your duel by /duelh");
                                    case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This is private duel ID. Create different duel by /duelh");
                                }
                        }
            }
            else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already on duel");
        return 1;
        }
        else if(strcmp(cmd, "/dueldec", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You uninvited. Create your duel by /duelh");
            }
            else
            {
                        if(Duel[duelid][dStarted] == 1)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible decline duel, when she has been started");
                        }
                        else
                        {
                            format(string, sizeof(string), "%s decline invite to duel. Duel was deleted", PlayerName[playerid]);
                            SendClientMessage(Duel[duelid][dHosterID], COLOR_DUEL, string);
                                ResetDuelVariables(duelid);
                            SendClientMessage(playerid, COLOR_DUEL, "You decline invite to duel");
                        }
            }
        return 1;
        }
        else if(strcmp(cmd, "/dueld", true) == 0)
        {
            new duelid = GetPlayerDuelID(playerid);
            if(duelid == 0)
            {
                    SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You haven't duel. Create your duel by /duelh");
            }
            else
            {
                        if(Duel[duelid][dStarted] == 1)
                        {
                            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible delete duel, when she has been started");
                        }
                        else
                        {
                                ResetDuelVariables(duelid);
                            format(string, sizeof(string), "%s delete duel (ID: %d)", PlayerName[playerid], duelid);
                            SendClientMessageToAll(COLOR_DUEL, string);
                        }
            }
                return 1;
        }
return 0;
}
Reply
#5

nvm..........
Reply
#6

I did, look at above. Just copy and paste.
Reply
#7

Now it says:
Код:
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(343) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(346) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(352) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(354) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(358) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(360) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(364) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(365) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(367) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(371) : error 010: invalid function or declaration
C:\Users\Ole\Desktop\New folder (2)\gamemodes\Untitled.pwn(568) : warning 203: symbol is never used: "stolbeg"
Reply
#8

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/duel", true) == 0)
    {
        SendClientMessage(playerid, COLOR_LIST_HEADER, ""#HEADER" Help for Advance Duel System:");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" "#USAGE_DUEL" - create duel");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelj [duel ID] - join to duel");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueldec - decline duel invite");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /dueld - delete duel");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duell - list of locations");
        SendClientMessage(playerid, COLOR_LIST_ITEM, ""#ITEM" /duelw - list of aviable weapons");
        return 1;
    }
    else if(strcmp(cmd, "/duelh", true) == 0)
    {
        new duelid = GetPlayerDuelID(playerid);
        if(duelid == 0)
        {
            new tmp1[TMP_SIZE];
            new tmp2[TMP_SIZE];
            new tmp3[TMP_SIZE];
            new tmp4[TMP_SIZE];
            new tmp5[TMP_SIZE];
            new inv = INVALID_PLAYER_ID;
            tmp1 = strtok(cmdtext, idx);
            tmp2 = strtok(cmdtext, idx);
            tmp3 = strtok(cmdtext, idx);
            tmp4 = strtok(cmdtext, idx);
            tmp5 = strtok(cmdtext, idx);
            if(strlen(tmp5) == 0) inv = INVALID_PLAYER_ID;
            else inv = strval(tmp5);
            new errorid = CreateDuel(playerid,strval(tmp1),strval(tmp2),strval(tmp3),strval(tmp4),inv);
            switch(errorid)
            {
                case -8: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" All duels ("#MAX_DUELS") already created. Wait please"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong location ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -5: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player is disconnected"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -6: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player already on duel"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
                case -7: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible invite youself"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
            }
        }
        else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already created duel");
        return 1;
    }
    else if(strcmp(cmd, "/duelj", true) == 0)
    {
        new duelid = GetPlayerDuelID(playerid);
        if(duelid == 0 || (duelid != 0 && Duel[duelid][dStarted] != 1))
        {
            new tmp1[TMP_SIZE];
            tmp1 = strtok(cmdtext, idx);
            if(strval(tmp1) <= 0)
            {
                SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong duel ID");
            }
            else
            {
                if(duelid != 0 && Duel[duelid][dInvitedID] != playerid && Duel[duelid][dStarted] != 1) ResetDuelVariables(duelid);
                new errorid = StartDuel(playerid,strval(tmp1));
                switch(errorid)
                {
                    case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This duel ID hasn't been created. Create your duel by /duelh");
                    case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" On this duel ID already playing. Create your duel by /duelh");
                    case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" This is private duel ID. Create different duel by /duelh");
                }
            }
        }
        else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already on duel");
        return 1;
    }
    else if(strcmp(cmd, "/dueldec", true) == 0)
    {
        new duelid = GetPlayerDuelID(playerid);
        if(duelid == 0)
        {
            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You uninvited. Create your duel by /duelh");
        }
        else
        {
            if(Duel[duelid][dStarted] == 1)
            {
                SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible decline duel, when she has been started");
            }
            else
            {
                format(string, sizeof(string), "%s decline invite to duel. Duel was deleted", PlayerName[playerid]);
                SendClientMessage(Duel[duelid][dHosterID], COLOR_DUEL, string);
                ResetDuelVariables(duelid);
                SendClientMessage(playerid, COLOR_DUEL, "You decline invite to duel");
            }
        }
        return 1;
    }
    else if(strcmp(cmd, "/dueld", true) == 0)
    {
        new duelid = GetPlayerDuelID(playerid);
        if(duelid == 0)
        {
            SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You haven't duel. Create your duel by /duelh");
        }
        else
        {
            if(Duel[duelid][dStarted] == 1)
            {
                SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible delete duel, when she has been started");
            }
            else
            {
                ResetDuelVariables(duelid);
                format(string, sizeof(string), "%s delete duel (ID: %d)", PlayerName[playerid], duelid);
                SendClientMessageToAll(COLOR_DUEL, string);
            }
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)