/badge doesn't wanna compile
#1

pawn Код:
command(badge, playerid, params[])
{
    new id, string[128];
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /badge [playerid]");
    }
    else
    {
        if(Groups[Player[playerid][Group]][CommandTypes] == 1)
        {
                if(GetDistanceBetweenPlayers(playerid, id) < 7)
                {
                    format(string, sizeof(string), "* %s has showed his/her badge to %s.", GetName(playerid), GetName(id));
                    NearByMessage(playerid, NICESKY, string);
                    format(string, sizeof(string), "You have shown your badge to %s.", GetName(id));
                    SendClientMessage(playerid, WHITE, string);
                    format(string, sizeof(string), "---------[LEO Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                    format(string, sizeof(string), "%s is an offical LEO", GetName(playerid));
                    SendClientMessage(id, COLOR_NBLUE, string);
                    format(string, sizeof(string), "---------[LEO Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "You're too far away!");
                }
            }
        }
        else
        {
            if(Groups[Player[playerid][Group]][CommandTypes] == 4)
            {
                if(GetDistanceBetweenPlayers(playerid, id) < 7)
                {
                    format(string, sizeof(string), "* %s has showed his/her badge to %s.", GetName(playerid), GetName(id));
                    NearByMessage(playerid, NICESKY, string);
                    format(string, sizeof(string), "You have shown your badge to %s.", GetName(id));
                    SendClientMessage(playerid, WHITE, string);
                    format(string, sizeof(string), "---------[GOVERNMENT Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                    format(string, sizeof(string), "%s is an offical Government employee.", GetName(playerid));
                    SendClientMessage(id, COLOR_NBLUE, string);
                    format(string, sizeof(string), "---------[GOVERNMENT Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "You're too far away!");
                }
            }
        }
    return 1;
}
pawn Код:
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(16171) : warning 217: loose indentation
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(16171) : error 029: invalid expression, assumed zero
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(16194) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
command(badge, playerid, params[])
{
    new id, string[128];
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /badge [playerid]");
    }
    else
    {
        if(Groups[Player[playerid][Group]][CommandTypes] == 1)
        {
            if(GetDistanceBetweenPlayers(playerid, id) < 7)
            {
                 format(string, sizeof(string), "* %s has showed his/her badge to %s.", GetName(playerid), GetName(id));
                 NearByMessage(playerid, NICESKY, string);
                 format(string, sizeof(string), "You have shown your badge to %s.", GetName(id));
                 SendClientMessage(playerid, WHITE, string);
                 format(string, sizeof(string), "---------[LEO Badge]---------", GetName(playerid));
                 SendClientMessage(id, COLOR_ORANGE, string);
                 format(string, sizeof(string), "%s is an offical LEO", GetName(playerid));
                 SendClientMessage(id, COLOR_NBLUE, string);
                 format(string, sizeof(string), "---------[LEO Badge]---------", GetName(playerid));
                 SendClientMessage(id, COLOR_ORANGE, string);
            }
            else
            {
                SendClientMessage(playerid, WHITE, "You're too far away!");
            }
        }
        else
        {
            if(Groups[Player[playerid][Group]][CommandTypes] == 4)
            {
                if(GetDistanceBetweenPlayers(playerid, id) < 7)
                {
                    format(string, sizeof(string), "* %s has showed his/her badge to %s.", GetName(playerid), GetName(id));
                    NearByMessage(playerid, NICESKY, string);
                    format(string, sizeof(string), "You have shown your badge to %s.", GetName(id));
                    SendClientMessage(playerid, WHITE, string);
                    format(string, sizeof(string), "---------[GOVERNMENT Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                    format(string, sizeof(string), "%s is an offical Government employee.", GetName(playerid));
                    SendClientMessage(id, COLOR_NBLUE, string);
                    format(string, sizeof(string), "---------[GOVERNMENT Badge]---------", GetName(playerid));
                    SendClientMessage(id, COLOR_ORANGE, string);
                }
                else
                {
                    SendClientMessage(playerid, WHITE, "You're too far away!");
                }
            }
        }
    }
    return 1;
}
Try now, you had an extra end bracket and then forgot an end bracket.

If you get more errors, tell me the lines of the errors so I can fix them.
Reply
#3

Gonna test now, no errors so far
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)