Error.
#1

Whats bugged here?

pawn Код:
CMD:pickup(playerid, params[])
{
    if(sscanf(params, "s[10]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pickup [type]");
        SendClientMessage(playerid, COLOR_GREY, "TYPES: Gun");
        return 1;
    }
    if(!strcmp(params, "gun", true))
        {
        if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
        new f = MAX_OBJ+1;
        for(new a = 0; a < MAX_OBJ; a++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
            {
                f = a;
                break;
            }
        }
        if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_WHITE, "You are not near the weapon which you can pick up!");
        DestroyObject(dGunData[f][ObjID]);
        GivePlayerWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
        dGunData[f][ObjPos][0] = 0.0;
        dGunData[f][ObjPos][1] = 0.0;
        dGunData[f][ObjPos][2] = 0.0;
        dGunData[f][ObjID] = -1;
        //dGunData[f][ObjData][0] = 0;
        dGunData[f][ObjData][1] = 0;
        new buffer[50];
        format(buffer, sizeof(buffer), "You picked up %s.", GunNames[dGunData[f][ObjData][0]]);
        SendClientMessage(playerid, COLOR_WHITE, buffer);
            }
        }
   return 1;
}
Код:
BCRP.pwn(5543) : error 010: invalid function or declaration
Line 5543:
pawn Код:
return 1;
Reply
#2

You had an extra brace, here:

pawn Код:
CMD:pickup(playerid, params[])
{
    if(sscanf(params, "s[10]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pickup [type]");
        SendClientMessage(playerid, COLOR_GREY, "TYPES: Gun");
        return 1;
    }
    if(!strcmp(params, "gun", true))
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
        new f = MAX_OBJ+1;
        for(new a = 0; a < MAX_OBJ; a++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
            {
                f = a;
                break;
            }
        }
        if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_WHITE, "You are not near the weapon which you can pick up!");
        DestroyObject(dGunData[f][ObjID]);
        GivePlayerWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
        dGunData[f][ObjPos][0] = 0.0;
        dGunData[f][ObjPos][1] = 0.0;
        dGunData[f][ObjPos][2] = 0.0;
        dGunData[f][ObjID] = -1;
        //dGunData[f][ObjData][0] = 0;
        dGunData[f][ObjData][1] = 0;
        new buffer[50];
        format(buffer, sizeof(buffer), "You picked up %s.", GunNames[dGunData[f][ObjData][0]]);
        SendClientMessage(playerid, COLOR_WHITE, buffer);
    }
    return 1;
}
Reply
#3

Oh yeah, im so dumb. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)